Live data from Hacker News

600k concurrent websocket connections on AWS using Node.js (2015)

blog.jayway.com

61–70 of 141 posts

Re: 600k concurrent websocket connections on AWS using Node.js (2015)

#61
post #59
post #14

Yeah, we used nginx-push-stream-module[1] to support 1M connections with lower boxes. Websocket-as-a-service. Really cool module. Was a realtime project for a live TV contest where people could participate with their phones. [1] https://github.com/wandenberg/nginx-push-stream-module

Did not know about this module. Instead, we are using a pretty identical one [1]. Works flawlessly [1] https://github.com/slact/nchan

Nchan is amazing

Re: 600k concurrent websocket connections on AWS using Node.js (2015)

#63

I don't get point of using Node.js when compared to something like Elixir. Elixir's Phoenix can handle more numbers of concurrent connections as well as provide reliability with better programming abstractions, distribution, pretty good language.

I am totally with you on Elixir/ Phoenix. But using Node.js is about leveraging frontend devs to get productive on the backend fast. At least, I think that’s the idea. Maybe also leveraging Google’s dependence on V8 (and thus all the engineering love it gets), although I don’t think that’s really a great argument compared to the EVM.

Well, Node.js is just good tech with a simple async-everything concurrency model.

Re: 600k concurrent websocket connections on AWS using Node.js (2015)

#64
post #58

Earlier quoted context omitted.

I recently played around with Athena for load balancer logs, and with sql it is easy to cross reference many connection entries from the load balancer. Do you believe this could help in getting more visibility to spot bottleneck problems stated in 2 and 3?

Not really, because there won't be logs for connections that were never established.

How are you keeping track of those?

Re: 600k concurrent websocket connections on AWS using Node.js (2015)

#65
post #37

Earlier quoted context omitted.

There are a handful of languages that would be suitable for this. The "right one" to use depends on more than just the language features for that task: - What third party libraries do you need to use? Some languages have very good support for some, and less for others. - What are the internal integrations you need to support? Can they be over the network or are you calling into code in a particular language? - What i…

This is a very typical diplomatic answer to stick with old, known programming languages.

Often case that isn't the wrong way to go. Newer doesn't mean better, and there's always trade-offs to consider. "It's newer" by itself really shouldn't be much of a consideration.

Re: 600k concurrent websocket connections on AWS using Node.js (2015)

#66
post #21

Earlier quoted context omitted.

Because javascript is one of the most popular programming languages in the world and the pool of Elixir programmers is almost non-existent?

> pool of Elixir programmers is almost non-existent Nonsense. There's more Elixir programmers (or at least those who want to program Elixir professionally) than there are Elixir jobs.

More Elixir programmers than Elixir jobs is not an incentive to learn and/or use a language.

Re: 600k concurrent websocket connections on AWS using Node.js (2015)

#67
post #27

Earlier quoted context omitted.

From this https://www.ycombinator.com/topcompanies/ Brex, Podium, PagerDuty use Elixir. They are in top YC companies, not a surprise.

Do you think they got big because they use it or do they use it because they're big? Pre-optimization is the root of all evil, my dude.

Discord used Elixir from the start

Re: 600k concurrent websocket connections on AWS using Node.js (2015)

#69
post #9

Earlier quoted context omitted.

One possible use is for high traffic websites. For example, StackExchange peaked at 500k concurrent websocket connections back in 2016. [0] [0] https://nickcraver.com/blog/2016/02/17/stack-overflow-the-ar...

Surely not on one endpoint

We’re spread over 9 servers but only due to ephemeral port and handle exhaustion issues. Each server is fronted by 4 HAProxy frontends that each handle ~18k connections.

Since Nick’s post we’ve moved from StackExchange.NetGain to the managed websocket implementation in .NET Core 3 using Kestrel and libuv. That sits at around 2.3GB RAM and 0.4% CPU. Memory could be better (it used to be We could run on far fewer machines but we have 9 sitting there serving traffic for the sites themselves so no harm in spreading the load a little!

Re: 600k concurrent websocket connections on AWS using Node.js (2015)

#70
post #11

Why is this specific to AWS ?

I think the idea is to dispel the myth that you can’t get that kind of performance on a cloud instance.

From what I understand there is no real "performance" in said test. Just a bunch of idle connections doing big nothing and eating all CPU time with garbage collection.
Post reply on HN