FastAPI

Event Loop Blocking Under Concurrent Load

critical
latencyUpdated Jan 10, 2026

FastAPI async endpoints exhibit serial-like behavior and inflated tail latency when synchronous operations (ORM calls, CPU-heavy tasks, blocking SDKs) execute directly on the event loop. Throughput plateaus while p95/p99 latencies climb despite moderate CPU usage.

How to detect:

Monitor for throughput plateau while p95/p99 latencies rise sharply, combined with moderate CPU utilization (50-70%) and increasing request queue times. Look for divergence between median latency (stable) and tail latency (climbing) under concurrent load.

Recommended action:

Identify blocking operations in async endpoints using structured logging around suspect code paths. Move synchronous database calls to async ORM equivalents, offload CPU-heavy operations to thread pools using asyncio.to_thread(), and wrap blocking third-party SDKs in executor pools. Validate fixes with targeted load tests measuring p95/p99 improvements.