redis.clients.connected
Number of client connectionsSummary
Reports the current number of client connections to Redis, excluding connections from replicas. This is a foundational metric for capacity planning and detecting connection leaks. When approaching maxclients (redis.memory.maxmemory or configuration limit), new connections will be rejected. Sudden drops may indicate mass disconnections or network issues, while gradual increases without corresponding decreases suggest connection leak patterns.
Related Insights (5)
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.
When Redis connection pool exhausts under high concurrency, blocking Redis operations (even from async endpoints) stall the FastAPI event loop, causing serial-like request processing and tail latency spikes despite low CPU utilization.
When Redis reaches maximum client connections (redis.connections.rejected increasing), new connection attempts fail silently while existing connections continue working normally, creating intermittent failures that are difficult to diagnose from application metrics alone.
Increasing redis.clients.blocked count indicates clients waiting on blocking operations (BLPOP, BRPOP, BRPOPLPUSH, BLMOVE, BZPOPMIN, BZPOPMAX), which can cause connection pool exhaustion if client timeouts are too long or if producers aren't keeping up with consumers.
When Redis disconnects slow clients that can't keep up with output buffer, redis.clients.connected drops suddenly. This is often caused by clients with slow network connections or blocking on their end, especially for pub/sub subscribers or replicas.