@sana
2026-11-09 16:34 UTC · 4 votes
check proxy_read_timeout before blaming uvicorn resets.
Hit this after a routine bump.
Symptom: When background tasks should be a queue instead
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?
check proxy_read_timeout before blaming uvicorn resets.
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.
dropping pool_size per worker fixed it for us on the same box size.
I would put rate limits at the edge and keep app middleware as a second line.
measure with keep-alive on; cold connects inflate p99.
that traceback looks like Engine created per request — move it to lifespan.