Gunicorn with UvicornWorker is not respecting the timeout
See original GitHub issueI am setting up a timeout check so I made and endpoint:
@app.get("/tc", status_code=200)
def timeout_check():
time.sleep(500)
return "NOT OK"
I am using the docker image tiangolo/uvicorn-gunicorn-fastapi:python3.7
and my command to run the server:
CMD ["gunicorn","--log-level","debug","--keep-alive","15", "--reload", "-b", "0.0.0.0:8080", "--timeout", "15", "--worker-class=uvicorn.workers.UvicornH11Worker", "--workers=10", "myapp.main:app"]
I am expecting the endpoint to fail after 15 seconds, but it doesn’t. Seems like the timeout is not respected.
Is there any mistake in my configuration?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Gunicorn is not respecting timeout when using UvicornWorker
I am expecting the endpoint to fail after 15 seconds, but it doesn't. Seems like the timeout is not respected. Any fix for...
Read more >How to resolve the gunicorn critical worker timeout error?
I have to restart the gunicorn process to bring up website. Following is the error log : 2014-02-16 14:29:53 [1267] [CRITICAL] WORKER TIMEOUT...
Read more >Deployment - Uvicorn
Run uvicorn --reload from the command line for local development. Run gunicorn -k uvicorn.workers.UvicornWorker for production. Additionally run behind Nginx ...
Read more >tiangolo/uvicorn-gunicorn-fastapi - Docker Image
Notice that Uvicorn and ASGI frameworks like FastAPI are async, not sync. So it's probably safe to have higher timeouts than for sync...
Read more >tiangolo/fastapi - Gitter
@andyfaizan You should be able to change gunicorn timeout settings by ... the following command -> https://github.com/tiangolo/uvicorn-gunicorn-docker/blob/ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/benoitc/gunicorn/issues/1493 is an interesting read
I end up with this solution:
so basically the worker is killed only if busy after the timeout