Replies: 1 comment
-
The python-socketio package is a web framework that provides behaviors on top of a web server. The web server on which you deploy your application will have some way to terminate active WebSocket connections and cancel active tasks, so more than anything this is something you need to research with a specific web server in mind, because the Socket.IO layer is too high-level for this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
Scenario: Multiple Python SocketIO Backend Pods within Kubernetes. Load (CPU/MEM) based horizontal scaling. ScaleUp for new connections is easy. But how to scale down.
If the Process receives a Sigterm the readiness probe will show not ready. That's easy. New Connections are not made to this pod.
But what to do with the old ones. SocketIO itself does disconnect all and the process terminates. The client can reconnect to any other pod within the system. Fine. But what happens to the currently running events within the server. SocketIO does not seem to finish them. Also, new events can be sent to the server (directly via ws or long polling via Kombu/Redis). We are handling all State via Redis.
So the Question is how to make sure no task gets lost. How to make sure all events/tasks are finished or transferred before shutdown and new ones are rejected or put into Redis?
Was not able to find any information on how to handle that with SocketIO.
Thank You
Beta Was this translation helpful? Give feedback.
All reactions