Greetings everyone!
Please - look at this issue
https://github.com/FZambia/centrifuge/issues/47There are several SockJS server backends and Nginx as load balancer. To route each client request to the same backend sticky sessions used.
So upstream looks something like this:
upstream app {
sticky;
server 1;
}
Clients connect to server 1 and then there is a moment when another server backend must be added:
upstream app {
sticky;
server 1;
server 2;
}
But new clients round-robin to both servers - so the load on server 1 continues to grow.
What we want here is least connections algorithm when sticky cookie is not set - so our both servers get approximately equal load. As far as I know this is not possible with Nginx.
So several questions here. Am I right? Or maybe I missing something and load balancer can be configured in another way which solves problem with unequal load. I saw examples of Haproxy config file (https://github.com/sockjs/sockjs-node/blob/master/examples/haproxy.cfg) which does load balancing by sockjs URL - how it behaves in situation described above?