Skip to content

Conversation

@grayside
Copy link
Collaborator

When a Cloud Run container instance idles between requests and withdraws CPU, there is a lack of heartbeat from the worker to the gunicorn arbiter process. A service in this state can have "WORKER TIMEOUT" error logs once CPU is restored upon receiving an HTTP request.

The timeout on workers is not an essential part of server resource management. Per benoitc/gunicorn#2291, gunicorn supports setting an unlimited timeout with --timeout 0. Let's do that to clean up the logs.

@grayside grayside requested review from a team and averikitsch as code owners March 30, 2020 22:34
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 30, 2020
@grayside grayside removed the request for review from leahecole March 30, 2020 22:46
@grayside grayside assigned grayside and unassigned leahecole Mar 31, 2020
@grayside grayside merged commit 9e64bff into master Mar 31, 2020
@grayside grayside deleted the run/python-timeout branch March 31, 2020 21:57
markhobson added a commit to acteng/update-your-capital-schemes that referenced this pull request Oct 11, 2023
Prevents `[CRITICAL] WORKER TIMEOUT` log messages when Cloud Run takes resources
away from Gunicorn.

Recommended by:

https://cloud.google.com/run/docs/tips/python#optimize_the_wsgi_server

More info:

GoogleCloudPlatform/python-docs-samples#3229
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants