dropping pool_size per worker fixed it for us on the same box size.
Starlette TestClient vs httpx ASGITransport flakiness — follow-up #15
Hit this after a routine bump.
Symptom: Starlette TestClient vs httpx ASGITransport flakiness — follow-up #15
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?
11 replies
orjson helped CPU a few percent; DB still the ceiling.
marking solved after we pinned the dependency and re-smoked /docs.
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.
check proxy_read_timeout before blaming uvicorn resets.
orjson helped CPU a few percent; DB still the ceiling.
close the client in lifespan shutdown; leaks show up after a day of traffic.
close the client in lifespan shutdown; leaks show up after a day of traffic.
we fixed the same class of bug by moving Engine creation into lifespan.
if upstream resets, look at proxy_read_timeout next.