Lua vs Node vs LuaNginx
pointlessramblings.com
pointlessramblings.com
> My Lua/LuaJIT implementations don't process/read any header fields, nor do they send any back (it's a simple server) I would expect this is the reason Lua/LuaJIT appears to fast. However it does demonstrate that a single process can easily handle 20,000 requests/s …
facepalm
I'm confused. What?
On the results, node didn't budge from 30 to 1000 concurrent connections, while the Lua servers just plain crashed, despite being faster at first. Conclusion: Lua is perfect for servers (?).
The Lua servers didn't crash; requests via browser worked fine during/after the benchmark. I'm not sure why ab kept hanging.
Maybe the same thing is happening with Lua?
Also what were the specs of the computer you ran your tests on?
I gave up micro benchmarking because once you factor in sessions and database access then everything goes in the gutter.
I've had a Go server outperform a Node server (same box, same data, same headers) by 5x when returning large amounts of json or returning large strings in general.
As soon as I had that data get returned by a database instead of hard coded strings using both language's best drivers for that database then the reqs/s evened out, in fact Node ended up performing slightly better for both latency and reqs/s.
The other (possible) option for real world use is to tweak nf_conntrack_tcp_timeout_time_wait and nf_conntrack_tcp_timeout_established to flush done connections from connection tracking quicker.
Have had some good use with this - read more here: http://blog.engineyard.com/2012/linux-scalability
The tests were made on a Micro VPS from Afterburst.com (which I own), on an empty/not-yet-deployed node.