Live data from Hacker News

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

blog.jayway.com

51–60 of 141 posts

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

#51
post #21

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.

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.

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

#52
post #4

So 1/4 of what Elixir/Erlang can handle, but more difficult and less reliable: https://phoenixframework.org/blog/the-road-to-2-million-webs...

Not fair ! You are comparing "4 CPUs and 15GB of memory" for NodeJS with "40 CPUs and 128 GB of memory" for Elixir/Phoenix

Ok, here's a better comparison:

"Websocket Shootout: Clojure, C++, Elixir, Go, NodeJS, and Ruby"

https://hashrocket.com/blog/posts/websocket-shootout

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

#53

There is more performant web-socket implementation than the one mentioned in the blog. It can handle 6X more connections and much less memory https://github.com/uNetworking/uWebSockets.js EDIT: Note that the blog post is from 2015. There are many optimization (Ignition and TurboFan pipeline) has been done in V8 since then, especially offloading GC activity to separate thread than NodeJS Main thread.

Unfortunately it is written by someone whose technical ability far exceeds his people skills, which are essential for a library module that developers can safely depend on. This is doubly unfortunate because I very much share his views on bloated frameworks etc. :(

Yeah that's the dev who pushed a purposefully broken version of their library to npm because he was upset that they wouldn't let him delete it.

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

#54

Earlier quoted context omitted.

Not fair ! You are comparing "4 CPUs and 15GB of memory" for NodeJS with "40 CPUs and 128 GB of memory" for Elixir/Phoenix

Ok, here's a better comparison: "Websocket Shootout: Clojure, C++, Elixir, Go, NodeJS, and Ruby" https://hashrocket.com/blog/posts/websocket-shootout

> NodeJS performance is hampered by its single-threaded architecture, but given that fact it performs very well. The NodeJS server was the smallest overall in lines of code and extremely quick and easy to write. Javascript is the lingua franca for web development, so NodeJS is probably the easiest platform for which to hire or train developers.

Do you actually read the blog post before making the claim ? The author is not using "Cluster" module to scale connections across CPUs with "Sticky-session" library. Also, neither he mentioned the runtime flags with which the launched all VMs in comparison nor he mentioned the optimization at OS level.

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

#55
Does anyone have a more recent experience? I currently use socket.io 2.2 with node v10.16, no v8 tweaks in a docker container. At ~1000 sockets, sometimes the server receives spikes of 8000 HTTP reqs/sec, which it has to distribute to the websockets, up to 100 msgs/sec, ~1kb/msg to each socket. These spikes are making the server unstable, socket.io switches most of the clients from websockets to xhr polling.

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

#56
post #15

A few pieces of advice based on running https://github.com/mozilla-services/autopush-rs , which handles tens of millions of concurrent connections across a fleet of small EC2 instances. 1) Consider not running the largest instance you need to handle your workload, but instead distributing it across smaller instances. This allows for progressive rollout to test new versions, reduces the thundering herd when you restar…

> 1) Consider not running the largest instance you need to handle your workload, but instead distributing it across smaller instances. This allows for progressive rollout to test new versions, reduces the thundering herd when you restart or replace an instance, etc.

I came here to say this. Horizontal compute is a miracle.

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

#57
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.

[deleted]

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

#58
post #15

A few pieces of advice based on running https://github.com/mozilla-services/autopush-rs , which handles tens of millions of concurrent connections across a fleet of small EC2 instances. 1) Consider not running the largest instance you need to handle your workload, but instead distributing it across smaller instances. This allows for progressive rollout to test new versions, reduces the thundering herd when you restar…

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.

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

#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

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

#60

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 don't understand people eating hot dogs. Hamburgers have...

Guess you haven't heard what hot dogs are made from

/s

Post reply on HN