RedisFastAPI

Redis Connection Pool Starvation from Blocking Patterns

warning
Connection ManagementUpdated Jan 10, 2026

When async endpoints make synchronous Redis calls, they hold connections longer than necessary while blocking the event loop, causing artificial connection pool exhaustion even when Redis server capacity is available.

How to detect:

Track redis.clients.connected approaching configured pool limits while redis.connections.rejected remains low or zero and redis.stats.instantaneous_ops_per_sec shows server has capacity. Correlate with increased client_backend_wait_time indicating pool contention.

Recommended action:

Convert synchronous Redis clients to async versions (aioredis/redis-py with async support). Review connection pool sizing - if using sync calls in async context, increase pool size as temporary mitigation while refactoring to truly async operations.