# sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30

- **ID:** `python/sqlalchemy-connection-pool-exhausted`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Too many concurrent connections exceeding pool limits.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **Increase pool size and overflow appropriately.** (85% success)
   ```
   engine = create_engine(url, pool_size=20, max_overflow=30)
   ```
2. **Use connection pooling middleware like PgBouncer.** (90% success)
   ```
   # Configure PgBouncer to pool connections externally
   ```

## Dead Ends

- **Setting pool_size to 0 (no limit).** — May cause database server overload. (60% fail)
- **Disabling pool pre-ping.** — Does not address connection exhaustion. (70% fail)
