GunicornFlask

Worker pool exhaustion causes exact 60-second request hangs

critical
Resource ContentionUpdated Feb 21, 2026(via Exa)
How to detect:

When all available worker threads are occupied (e.g., 2 workers * 4 threads = 8 concurrent slots), subsequent incoming requests are queued and hang for precisely 60 seconds before completing. This occurs when synchronous callbacks lock worker threads during execution, saturating the worker pool. The 60-second delay corresponds to network layer or HTTP Keep-Alive timeout defaults.

Recommended action:

Immediate fix: Switch to gevent worker class and increase worker count to (2 * CPU_cores) + 1. For 4-core machine, use 9 workers with gevent. Long-term fix: Implement asynchronous callback execution using Celery or task queues to decouple user requests from long-running data processing. Configure with: gunicorn app:server --workers 9 --worker-class gevent --bind 0.0.0.0:8000 --timeout 60