-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shorten startup time for multiple workers #2693
Comments
I am setting the variable
Before your application startup. I put it into the gunicorn config for now, so it looks something like this:
I still think starting the workers one by one would be a really nice feature if that is not possible at the moment. It would be super nice if you could add that caveat in the configuration documentation for the preload parameter to reduce the amount of headaches in the world :) |
never do that. You will unblock the arbiter loop which will result in bad supervision. Is your code using global variable that need to be used before your application is loaded? |
In our experience running a large production application and performing the gevent-monkey patch before even importing gunicorn, we have noticed no problems over the course of many years. cf #1566 |
@benoitc I haven't experienced any issue with the workaround so far. I would be interested to know more about the issue you describe and discuss a better way forward like an alternative way to doing the application pre-load or starting the workers one by one. |
no activity since awhile. closing feel free to create a new ticket if needed. |
Hi,
When running our application with gunicorn with multiple workers I notice a considerable delay during startup.
All workers start in parallel and each worker takes an average of 5 sec to start.
What happens now with 8 workers is basically that the first worker completes its startup after roughly ~5*8 seconds instead of after 5 seconds.
Is there an easy way to make the worker startup sequential, like add a custom delay so that one of the workers can already start processing requests until the other workers are started? Or do I need to add some server hooks?
gunicorn 20.1.0
worker_class = 'gevent'
gevent 21.8.0
Python 3.9
The text was updated successfully, but these errors were encountered: