Ask HN: Approaches to load balancing web sockets?
Might be simple, just trying to think of sane ways to do it. These are plain web sockets in Web JS to Node not using something like socket.io. It's user A to server to user B and vice versa.
There would be some kind of db involved in the event of it going down/can reconnect people by some ids.
My concern is do you keep say multiple domain options on the app (by env variables) or do you have a single url you hit (no?) and that branches off to different instances.
Scale is small now as in 10/100s of users, performance is not like a video game but still real time/more than text chat. The data rate is still low, mostly transferring meta data.
6 comments
[ 3.1 ms ] story [ 21.2 ms ] threadOn cross-domain communications, should be good as long as it's 12-factor where you got a session store / pub-sub mechanism that both servers can use.
- https://github.com/uNetworking/uWebSockets.js
- https://12factor.net/