@tara
2026-10-28 13:21 UTC · 2 votes
orjson helps CPU a bit; it will not save a saturated DB.
Hit this in staging after bumping workers.
Error / symptom: Should we put Redis in front of /users?
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?
orjson helps CPU a bit; it will not save a saturated DB.
also check you are not creating an Engine inside the request.
also check you are not creating an Engine inside the request.
orjson helps CPU a bit; it will not save a saturated DB.
paste your sqlalchemy engine kwargs. pool_size and max_overflow matter more than worker count here.