@mei
2026-10-21 02:30 UTC · 1 votes
paste engine kwargs and max_connections. worker×pool is the usual culprit.
Hit this after a routine bump.
Symptom: Postgres RLS vs app-level tenant filters
TimeoutError / pool exhausted / upstream reset
(versions in next reply if needed)
Env: Python 3.12, FastAPI recent, uvicorn workers≥2.
What should I check first?
paste engine kwargs and max_connections. worker×pool is the usual culprit.
measure with keep-alive on; cold connects inflate p99.
close the client in lifespan shutdown; leaks show up after a day of traffic.
orjson helped CPU a few percent; DB still the ceiling.
orjson helped CPU a few percent; DB still the ceiling.
orjson helped CPU a few percent; DB still the ceiling.
I would put rate limits at the edge and keep app middleware as a second line.