Live data from Hacker News

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

blog.jayway.com

91–100 of 141 posts

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

#91

Earlier quoted context omitted.

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

No, but Elixir/Erlang OTP is worth learning in and of itself.

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

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

How meaningful is the benchmark for handling idle connections? Handling more is better, of course, but if the server melts down when 0.1% of them have any activity, maybe maximizing idle connections isn't the right place to expend optimization effort?

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

#93
Lots of wisdom on this page ;)

Just want to add. Real-world, often the predominant use case is not optimizing for "max-conns". But In this instance, I've found Caddy's websocket directive, inspired by Websocketd, to be quite robust and elegant. It's just a process per conn. Handling stdin, stout style messaging ;)

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

#94

Earlier quoted context omitted.

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.

Ya. nodejs is "JavaScript bindings for libev".

Deno (also by Ryan Dahl) "TypeScript bindings for libev" may become a viable successor. https://deno.land/manual.html#introduction

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

#95

Earlier quoted context omitted.

@runj__ You should read this blog post by Brex founder. He really says how Elixir suited well to the problem they were trying to solve https://medium.com/brexeng/why-brex-chose-elixir-fe1a4f31319...

In the end they picked it because they already knew it.

That's still a really good reason to pick a technology right? Especially if speed to market is one of your goals.

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

#98

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.

The difference in performance between any languages are very small, like only one order of magnitude, but it's usually possible to get two orders of magnitude better performance in any language by optimizing. Eg. If your manager wont allow you to cut the AWS bill 100x by doing some optimizations. He she/she will certainly not allow you to rewrite everything in another language in order to cut bills by 10x.

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

#99

Earlier quoted context omitted.

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

No, but Elixir/Erlang OTP is worth learning in and of itself.

I mean, sure, but i already have a long list of that, probably longer than I can learn in a lifetime.

Things get prioritised when they help pay the bills

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

#100

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.

I don't have any experiments to share, but you can go father if you stop using socket.io, but I guess you need something to deal with long polling.

You should consider tweaking --max_old_space_size, we got a lot of mileage giving node more memory.

Post reply on HN