Live data from Hacker News

Lua vs Node vs LuaNginx

pointlessramblings.com

1–10 of 15 posts

Re: Lua vs Node vs LuaNginx

#2
Go also hangs at the end with a lot of concurrent requests. I think it has something to do with how it time outs http connections.

Maybe the same thing is happening with Lua?

Also what were the specs of the computer you ran your tests on?

Re: Lua vs Node vs LuaNginx

#3

Go also hangs at the end with a lot of concurrent requests. I think it has something to do with how it time outs http connections. Maybe the same thing is happening with Lua? Also what were the specs of the computer you ran your tests on?

Sounds quite likely the same thing is happening to Lua.

The tests were made on a Micro VPS from Afterburst.com (which I own), on an empty/not-yet-deployed node.

Re: Lua vs Node vs LuaNginx

#4

Go also hangs at the end with a lot of concurrent requests. I think it has something to do with how it time outs http connections. Maybe the same thing is happening with Lua? Also what were the specs of the computer you ran your tests on?

I did something similar two years ago with Lua + sockets, same experience (but I never persisted with it long enough to figure out why, since my project was finished)

Re: Lua vs Node vs LuaNginx

#6
post #5

Yet another hello world ab competition with no source code, setup, kernel parameter info or whatsoever

And this:

> 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

Re: Lua vs Node vs LuaNginx

#8

Go also hangs at the end with a lot of concurrent requests. I think it has something to do with how it time outs http connections. Maybe the same thing is happening with Lua? Also what were the specs of the computer you ran your tests on?

He doesn't post much about his setup to know for sure, but it's possible that he was running out of ephemeral ports.

Re: Lua vs Node vs LuaNginx

#9

Go also hangs at the end with a lot of concurrent requests. I think it has something to do with how it time outs http connections. Maybe the same thing is happening with Lua? Also what were the specs of the computer you ran your tests on?

Does this happen with keepalive on (-k option for ab) as well? If not, it might be some network resource starvation issue (connection tracking or TIME_WAIT, try "sysctl -w net.ipv4.tcp_tw_reuse=1" or "sysctl -w net.nf_conntrack_max=655360" perhaps).

Re: Lua vs Node vs LuaNginx

#10

Go also hangs at the end with a lot of concurrent requests. I think it has something to do with how it time outs http connections. Maybe the same thing is happening with Lua? Also what were the specs of the computer you ran your tests on?

Does this happen with keepalive on (-k option for ab) as well? If not, it might be some network resource starvation issue (connection tracking or TIME_WAIT, try "sysctl -w net.ipv4.tcp_tw_reuse=1" or "sysctl -w net.nf_conntrack_max=655360" perhaps).

It still happens with -k but I haven't tried the other tweaks.

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.

Post reply on HN