GunicornNGINX

Request queueing in connection backlog due to insufficient workers

warning
Resource ContentionUpdated Aug 27, 2025(via Exa)
How to detect:

Requests show response times of 3-22 seconds between Nginx and Gunicorn, while actual processing within Gunicorn takes less than 1 second. Requests accumulate in the connection backlog, indicating insufficient worker processes to handle the load.

Recommended action:

Increase the number of Gunicorn workers using the workers/worker-processes setting. Compare Nginx upstream timing (request_time, upstream_connect_time, upstream_header_time, upstream_response_time) with Gunicorn access log timing to identify queueing. Implement busy worker count tracking using pre_request and post_request hooks with multiprocessing.Semaphore to monitor worker utilization.