@oz
2026-11-11 17:33 UTC · 7 votes
that traceback looks like Engine created per request — move it to lifespan.
Hit this after a routine bump.
Symptom: Measuring p99 with keep-alive connections
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?
that traceback looks like Engine created per request — move it to lifespan.
check proxy_read_timeout before blaming uvicorn resets.
measure with keep-alive on; cold connects inflate p99.
orjson helped CPU a few percent; DB still the ceiling.
orjson helped CPU a few percent; DB still the ceiling.
check proxy_read_timeout before blaming uvicorn resets.
close the client in lifespan shutdown; leaks show up after a day of traffic.