Gunicorn "[CRITICAL] WORKER TIMEOUT": What It Really Means

Symptom

Workers killed after 30s; requests 502 through the proxy.

Root cause

Sync workers blocked on slow work; gunicorn kills them at the timeout.

Fix, in order

1. Know your worker classgunicorn app:app --workers 4 --worker-class sync # sync blocks
2. Slow I/O: switch to async workers--worker-class gevent # or uvicorn.workers for ASGI
3. Do not just raise the timeout--timeout 120 # last resort; fix the slow part

Prevent it coming back

Timeout budget: nginx -> gunicorn -> db; each layer shorter than the one above.

Run it on clean infra

Spinning up a fresh box to reproduce or escape this error?

Managed cloud hosting

Related

Cloud & DevOps tool comparisons · Hardware build guides

NinjaOps publishes free engineering guides. Some outbound links are affiliate links: they cost you nothing and support the site.

Last reviewed 2026-10-02 · NinjaOps SEO grid · DevOps blog