@raul
2026-10-16 12:49 UTC · 10 votes
orjson helped CPU a few percent; DB still the ceiling.
Hit this after a routine bump.
Symptom: SQLAlchemy AsyncSession inside BackgroundTasks?
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?
orjson helped CPU a few percent; DB still the ceiling.
paste engine kwargs and max_connections. worker×pool is the usual culprit.
dropping pool_size per worker fixed it for us on the same box size.
orjson helped CPU a few percent; DB still the ceiling.
minimal repro with ASGITransport would help more than screenshots.
dropping pool_size per worker fixed it for us on the same box size.
measure with keep-alive on; cold connects inflate p99.
measure with keep-alive on; cold connects inflate p99.
orjson helped CPU a few percent; DB still the ceiling.