express-ws icon indicating copy to clipboard operation
express-ws copied to clipboard

express ws in clustered application

Open khalilTN opened this issue 6 years ago • 2 comments

Hello,

I'm facing a problem that forced me to disable clusters until i find a solution. I'm using clusters, and i'm saving web-socket connection objects in an object in memory. The problem occurs when a request fall into another cluster than the one where the connection was opened, then the connection cannot be found. I tried to use a cross-process store so that connections object can be shared between clusters, but the connection object is circular and cannot be serialized. How can i deal with this ?

Thanks

khalilTN avatar Dec 17 '18 15:12 khalilTN

I also have this dilemma.

grahamtallen avatar Dec 18 '18 21:12 grahamtallen

Websockets behind clusters must have sticky connections.

That's a concept that load balancers implements to always deliver a client (a connection) to the same host once the initial connection is made.

macedd avatar Jan 15 '19 21:01 macedd