Flowise icon indicating copy to clipboard operation
Flowise copied to clipboard

[question] socket.io sticky session / multiple nodes

Open niztal opened this issue 1 year ago • 3 comments

Hi,

I've seen flowise is based on socket.io in order to communicate with the client. I wonder what would happen if flowise will have multiple nodes/replicas/pods, how can we keep that the sessions of socket.io won't be sticky to a specific node/replica/pod?

I didn't see flowise has the option to integrate socket.io with a certain adapter (https://socket.io/docs/v4/using-multiple-nodes/#enabling-sticky-session) nor configure the transports as websocket

Thanks,

niztal avatar May 06 '24 20:05 niztal

@HenryHengZJ ?

niztal avatar May 08 '24 10:05 niztal

a new socket connection is established/closed whenever user open or close the chatbox, so in the case of multiple nodes/replicas/pods I dont think that will be an issue. Though we are working on using SSE and moving away from socketio

HenryHengZJ avatar May 08 '24 22:05 HenryHengZJ

a new socket connection is established/closed whenever user open or close the chatbox, so in the case of multiple nodes/replicas/pods I dont think that will be an issue. Though we are working on using SSE and moving away from socketio

I'm not sure that's true.

Think of a case where you're using kubernetes and you have a public ingress, your service holds let's say 3 pods for the example. Now once you open the chatbot you were interacting with pod #1 , later on the ingress decided to route your request to pod #3. In that case the application will fail. In such cases you must use persistency in order to avoid session stickiness.

LMK if I miss anything.

Thanks @HenryHengZJ

niztal avatar May 09 '24 03:05 niztal

Hi @HenryHengZJ

Any updates with moving from socket.io to SSE?

Thanks

niztal avatar Jun 30 '24 19:06 niztal