NGINXFastAPI

Event Loop Blocking Causes Serial Request Processing

critical
latencyUpdated Jan 10, 2026

When NGINX proxies to async application servers (FastAPI, Node.js) but those backends make blocking I/O calls, the event loop stalls, causing serial-like request processing despite async infrastructure. Symptoms include flat throughput curves and rising tail latency even when CPU is moderate.

How to detect:

Detect when nginx_upstream_peers_response_time increases while nginx_upstream_peers_active remains low and system CPU < 70%. Look for correlation between nginx_upstream_peers_response_time_histogram tail percentiles (p95, p99) rising while request rate (nginx_server_zone_processing) plateaus despite available capacity.

Recommended action:

Investigate upstream application servers for blocking operations in async code paths (synchronous ORM calls, CPU-heavy transformations, blocking SDK calls). Instrument event loop lag on backends. Move blocking operations to thread pools or separate worker processes. Consider switching blocking upstreams to process-based workers instead of async models.