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
Shutdown takes 30 second to complete #901
Comments
I found that's because at least one socket is stuck at
The threads stuck in that function, will print this following after about 15 minute of inactivity, (and socket is closed):
|
Closing in favor of #922 to keep the issues tidy. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary:
Gunicorn (sometimes) takes several (up to 30) seconds to shutdown (without any request in progress). We use gunicron behind nginx, and this bug leads to huge increase in upstream time in nginx servers.
During stop interval listening socket is open, so nginx connects to it, and waits for connect (but gunicron doesn't even accept connections, because it's in shutdown stage). After shutdown, sockets are closed, and nginx retries with another upstream server, but with an unnecessary wait of several seconds.
This doesn't happen in a light (development) environment, but happens when gunicorn is under load of ~10 req/s (all requests always take less than 0.2s to complete).
Envrionment:
gunicron 19.1.1 (using 16 process, each with 5 thread) on Python 3.4.1 / CentOS 7 behind nginx 1.6.1 on FreeBSD
Log file:
This is errorlog with debug level:
Config file:
The text was updated successfully, but these errors were encountered: