Gunicorn

Gunicorn timeout setting does not stop individual async requests

info
configurationUpdated Mar 1, 2026(via Exa)
Technologies:
How to detect:

The --timeout flag in Gunicorn is a heartbeat timeout that monitors worker process health, not a per-request timeout. Because Uvicorn workers are asynchronous and can handle many concurrent requests, the worker remains 'alive' and responsive to master even if individual requests are hanging or running past the timeout threshold. Gunicorn will not kill the worker or stop specific long-running requests.

Recommended action:

Do not rely on --timeout to stop long-running requests on async workers. Instead, implement application-level timeouts using asyncio.wait_for with appropriate timeout values. The --timeout setting should be configured to ensure worker processes respond to master heartbeat checks, not to limit individual request duration.