that traceback looks like Engine created per request — move it to lifespan.
When background tasks should be a queue instead — follow-up #20
Hit this after a routine bump.
Symptom: When background tasks should be a queue instead — follow-up #20
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?
10 replies
minimal repro with ASGITransport would help more than screenshots.
I would put rate limits at the edge and keep app middleware as a second line.
marking solved after we pinned the dependency and re-smoked /docs.
dropping pool_size per worker fixed it for us on the same box size.
measure with keep-alive on; cold connects inflate p99.
orjson helped CPU a few percent; DB still the ceiling.
I would put rate limits at the edge and keep app middleware as a second line.
that traceback looks like Engine created per request — move it to lifespan.
check your workers first; each one duplicates logging handlers.