0

How to handle more than 65535 active connections? How to load balance it properly?
I think that it is possible if we use orchestration. So, we need to ask a special service which server we must contact. But I don't like this solution only because we don't know which node exactly we have to give to the user. If we give the server with the lowest number of WebSocket connections there can be a big percentage of active connections (30k for example) and the performance can suffer. If we give the server with the lowest number of active connections it can be changed soon (users which were passive became active) and performance can suffer again.

How to properly load balance connections to distribute load almost equally among servers?

Oleksandr
  • 3,574
  • 8
  • 41
  • 78
  • http://stackoverflow.com/questions/12526265/loadbalancing-web-sockets – dm03514 Oct 24 '16 at 16:51
  • [Node.js w/1M concurrent connections!](http://blog.caustik.com/2012/08/19/node-js-w1m-concurrent-connections/) and [Scaling to 12 Million Concurrent Connections: How MigratoryData Did It](https://mrotaru.wordpress.com/2013/10/10/scaling-to-12-million-concurrent-connections-how-migratorydata-did-it/). – jfriend00 Oct 24 '16 at 17:04
  • If you are regularly evenly load balancing as each new webSocket connection comes in, then there is no reason to believe that more active connections would end up on one server vs. another. The law of large numbers makes that a very low probability. Your load balancing algorithm could also slowly fill a serve that is more empty than others rather than put all new traffic there until it's even. That would make it less likely that a whole batch of new and active users all got assigned to one server. But, again with the law or large numbers, you shouldn't get huge imbalances anyway. – jfriend00 Oct 24 '16 at 17:06
  • The references do not answer your first question. The 65535 hard limit applies to outgoing TCP connections, which are between load balancer and the backend servers. If you have more than that many connections, I think you would have to have multiple IPs for the load balancer to talk to backend servers. Or use a cluster of load balancers. That's my guess. Is that right? How do large companies organize a cluster of load balancers? – Guangtong Shen May 06 '19 at 19:37

0 Answers0