Redis/Cosmos/Blob client pools.
Pool exhaustion happens when clients are created per request or concurrency exceeds pool limits. This playbook focuses on singleton clients and pool sizing.
- "too many connections" errors
- Connection timeouts or stalled requests
- Check pool limits vs concurrent load.
- Verify connections are reused.
- Look for leaked sessions or clients.
- Increase pool size temporarily.
- Restart services with clean pools.
- Reduce concurrency for heavy workloads.
- Reuse client instances (singleton per app).
- Configure sane pool sizes and timeouts.
- Create clients once at startup and reuse.
- Size pools based on concurrency and throughput.
- Add monitoring for pool utilization.
class Clients:
hot = HotMemory("redis://localhost:6379", max_connections=50)
warm = WarmMemory("https://account.documents.azure.com", "db", "container", connection_limit=50)
cold = ColdMemory("https://storage.blob.core.windows.net", "container", connection_pool_size=50)flowchart TD
A[Pool exhaustion] --> B[Check client lifecycle]
B --> C{Per-request client?}
C -->|Yes| D[Move to singleton]
C -->|No| E[Increase pool size]
E --> F[Reduce concurrency]
If pool exhaustion repeats, review traffic patterns and adjust scaling.