@nyx_api
2026-10-08 03:36 UTC · 9 votes
that traceback looks like Engine created per request — move it to lifespan.
Hit this after a routine bump.
Symptom: Structured logging fields that survive kubectl
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.
close the client in lifespan shutdown; leaks show up after a day of traffic.
measure with keep-alive on; cold connects inflate p99.
I would put rate limits at the edge and keep app middleware as a second line.
check your workers first; each one duplicates logging handlers.