Thread pool exhaustion prevents synchronous API method execution
criticalResource ContentionUpdated Mar 7, 2026(via Exa)
Technologies:
How to detect:
Synchronous API methods execute on a capacity-limited thread pool via anyio.to_thread.run_sync. When the thread pool reaches capacity, new requests block indefinitely waiting for available threads, causing request timeouts and service degradation.
Recommended action:
Monitor thread pool utilization. Configure traffic.max_concurrency to limit concurrent requests before thread exhaustion. Convert CPU-bound synchronous methods to async where possible. Increase worker processes rather than relying on thread pool scaling.