Hacker News new | ask | show | jobs
by dnekencjfkerf 2670 days ago
> What this means, performance-wise, is that measuring requests per second gets a lot more attention than connections per second. Usually, the latter can be one or two orders of magnitude lower than the former.

does anyone know how does 100k connections compare with other servers?

4 comments

It's probably easy to do with Java / C# and Go, they're using a 36 cores machine to achieve that with fast CPU, meaning that you need 3000conn/sec per core, very doable with recent frameworks.
Should be possible just fine with NodeJS, so long as it's clustered to run an instance per core.

The order of magnitude(s) differentiator for server performance really comes down to whether or not the architecture is blocking or non-blocking.

We run about 20k connections per second with nodejs on a 12 core machine. All node is doing is parsing cached JSON, modifies it and serve it back to the client. One server has an uptime of 560days without any memory/performance issues.
Java was able to that for the longest time. I remember seeing async io based servers doing 500K or 1M connections per machine in the last ten years. In all cases they needed to reconfigure the OS kernel since that's where the bottleneck was.
A quick search shows that the problem has been shifted to tackle the so called C10M problem, with C1M/second. That was couple years ago. Not sure what the current state is.

http://highscalability.com/blog/2013/5/13/the-secret-to-10-m...

https://mrotaru.wordpress.com/2015/05/20/how-migratorydata-s...

With Python/uvloop I can easily get 10K-12K connections per second per core, so 36 cores will be fine with Python too.
Can you show me your example code?

Also, assuming it scales up linearly is a bit risky, although I agree with that kind of conn/s I am sure it will be sufficient.

Nothing special, just usual asyncio Protocol with uvloop policy.
I would love to see the code.
On my desktop computer with a single thread, Ruby can handle about 2000/conn/s. I'm just going to check a single thread with a similar C++ implementation.