You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the simplest setup for scaling Flask-SocketIO via a Docker Swarm deployment scheme?
I've read through a few of the closed issues on this forum (ex. #694, #618, #1401) and believe I understand the crux of the limitations for scaling a Flask-SocketIO deployment when using gunicorn - mostly due to lack of support for sticky sessions. I've seen your solution to scaling by starting several instances on different ports and using Nginx to load balance them. However, I was wondering if there was an approach that was easily compatible with a typical Docker Swarm deployment, where you may want to scale your SocketIO app to 3+ replicates. I've started looking through this example, and will continue to try it, but was hoping to get your/others thoughts before spending too much time in case there was something I was missing or a tutorial on the internet that I have missed.
The text was updated successfully, but these errors were encountered:
I don't use Docker swarm, so I don't know. I've made it work with Kubernetes back in the day, using a Haproxy load balancer configured with sticky sessions and a Redis for communication between the replicas.
Hey @miguelgrinberg I did end up getting this to work quite well using Traefik instead of Nginx as the reverse proxy. Do you have any recommendations on the best place to post a solution so that others can find it if needed?
What is the simplest setup for scaling
Flask-SocketIO
via a Docker Swarm deployment scheme?I've read through a few of the closed issues on this forum (ex. #694, #618, #1401) and believe I understand the crux of the limitations for scaling a Flask-SocketIO deployment when using gunicorn - mostly due to lack of support for sticky sessions. I've seen your solution to scaling by starting several instances on different ports and using Nginx to load balance them. However, I was wondering if there was an approach that was easily compatible with a typical Docker Swarm deployment, where you may want to scale your SocketIO app to 3+ replicates. I've started looking through this example, and will continue to try it, but was hoping to get your/others thoughts before spending too much time in case there was something I was missing or a tutorial on the internet that I have missed.
The text was updated successfully, but these errors were encountered: