Hacker News new | ask | show | jobs
by inglor 1211 days ago
We did this with Node.js and uWebSockets and it scaled easily to a few million web sockets on ~10 machines so I can confirm the stack works in practice
2 comments

We used the C++ version of uWebSockets to replace a legacy node app. We went from four fully loaded cores to about 20% of a single core and a fraction of the memory usage. It's a great library.
I am trying to imagine why one would need millions of web sockets :) What are the use cases here?
Millions of clients. IOT devices? Who knows.
It's unlikely you'd want to connect IOT devices to a backend using web sockets, I'd use a UDP based protocol for that, e.g. QUIC. But for web clients it makes sense.
MQTT is usually the go to protocol for IOT devices. You can do MQTT over WebSockets to help prevent issues using odd ports on home networks etc.
This was working for Peer5 (YC startup) - building a p2p CDN, these were video viewers in live events (e.g. the world cup).