News for hackers. Stuff that matters.
Re:The Architecture of Open Source Applications: Nginx by sinzone on Monday November 23, 2015 @08:39PM (#10618622)
Lua support in nginx is phenomenal, especially when combined with LuaJIT. It basically allows to transform nginx into an application server and run arbitrary code that can pretty much do anything.

I would like to mention agentzh and his team that did an amazing job in releasing OpenResty[1] which makes it easy to extend nginx with custom Lua functionality, which also happens to be the backbone of CloudFlare architecture, and the core technology being used by projects like Kong[2] when it comes to microservices management.

[1] http://openresty.org/

[2] https://github.com/Mashape/kong

Re:The Architecture of Open Source Applications: Nginx by kator on Monday November 23, 2015 @09:01PM (#10618702)
+1

I built a nginx+luajit RTB bidder that did 168k qps on 8 cores. It smashed the C eventlib version and of course it crushed the Java version. Golang came in a close second but at the time with 8 cores I had to do crazy things to get it to pin to CPU's since the golang thread scheduling didn't seem very scaleable beyond 4 cores.

Re:The Architecture of Open Source Applications: Nginx by lpgauth on Monday November 23, 2015 @09:16PM (#10618763)
168K/s? Did you actually decode the bid request (json) or just return no bid? That seems too good to be true.
Re:The Architecture of Open Source Applications: Nginx by fit2rule on Tuesday November 24, 2015 @03:10AM (#10619685)
I also would love to know details about this .. very impressive stats!
Re:The Architecture of Open Source Applications: Nginx by royjacobs on Tuesday November 24, 2015 @04:09AM (#10619838)
These bidding platforms typically don't provide you with JSON but with some headers or query parameters that are very quick to parse (especially for the native nginx code), so your Lua code can basically boil down to a few table lookups.
Re:The Architecture of Open Source Applications: Nginx by lpgauth on Tuesday November 24, 2015 @10:05AM (#10621077)
Uh, look up OpenRTB. Except for Doubleclick Adx almost all exchanges encode bid requests in JSON.
Re:The Architecture of Open Source Applications: Nginx by ww520 on Tuesday November 24, 2015 @03:27AM (#10619725)
May be I got it the wrong. Are the time spent on the bid processing portion (CPU bounded) or the network messaging and connection handling portion (IO bounded)? When talking about eventlib and nginx, I assume the network messaging and connection handling are relevant. In that case 168K requests/sec doesn't sound too great.

This benchmark shows Ngix+Lua (openresty) is more than 5 times slower than the leading ones, which can do more than 6M requests/sec.

https://www.techempower.com/benchmarks/#section=data-r11&hw=...

Re:The Architecture of Open Source Applications: Nginx by jimjag on Tuesday November 24, 2015 @08:16AM (#10620469)
The problem w/ engine's Lua support is that it doesn't go far enough. Apache's mod_lua allows you to create complete modules for Apache, with total access to Apache's API.