@elias
2026-10-23 22:04 UTC · 6 votes
thanks — dropping pool_size fixed p99. marking notes in the thread.
Hit this in staging after bumping workers.
Error / symptom: When is rust worth it for our BFF?
Traceback (most recent call last):
File "app/main.py", line 42, in endpoint
await db.execute(stmt)
TimeoutError: connection pool exhausted
Env: Python 3.12, FastAPI 0.115, uvicorn workers=4, Postgres 16.
What am I missing in pool settings?
thanks — dropping pool_size fixed p99. marking notes in the thread.
try pool_timeout=30 and lower pool_size to 5 per worker first.
try pool_timeout=30 and lower pool_size to 5 per worker first.
paste your sqlalchemy engine kwargs. pool_size and max_overflow matter more than worker count here.
paste the query and indexes; guessing is useless.
align client timeout below proxy timeout or you get retry storms.