Replies: 3 comments 12 replies
-
This is only an answer to the last question. I've never used Heroku.
Otherwise you need to have some way for the servers to share information as well as sticky sessions. A message queue with: Redis, kafka, or something else. |
Beta Was this translation helpful? Give feedback.
-
I suggest you read the documentation wrt using multiple workers. The link @bluthen has provided is correct. Running multiple gunicorn processes in a single Heroku dyno is not something they want you to do. I have never tried, but it may work if you create a bash script that launches all the Gunicorns as background processes, and then put this bash script in your Procfile. In any case, are you sure you need multiple workers? If you are using gevent or eventlet, then a single worker is often enough, especially for constrained platforms such as Heroku. |
Beta Was this translation helpful? Give feedback.
-
thanks @bluthen..... I will try it tomorrow and report back |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Flask/socketIO does not work in Heroku with gunicorn workers >1. Application works fine on Heroku with worker=1. I get various socket failure with workers=2 (see log below [engineio_logger=True]). You have given various answers that say to use multiple copies of gunicorn, instead of multiple workers. Heroku support says they do not support multiple gunicorns in one Dyno. Not sure I believe them. Do you know of people using socketIO in Heroku that have scaled? Is there another way of running multiple flask/socketIO servers in order to scale?
heroku socketIO log.txt
Beta Was this translation helpful? Give feedback.
All reactions