@rina_lab79
2026-11-09 05:07 UTC · 6 votes
that traceback looks like Engine created per request — move it to lifespan.
Hit this after a routine bump.
Symptom: uvicorn access log rotation without losing requests
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.
orjson helped CPU a few percent; DB still the ceiling.
measure with keep-alive on; cold connects inflate p99.
dropping pool_size per worker fixed it for us on the same box size.
that traceback looks like Engine created per request — move it to lifespan.
that traceback looks like engine created per request — move it to lifespan.
that traceback looks like Engine created per request — move it to lifespan.
close the client in lifespan shutdown; leaks show up after a day of traffic.