discussion 2026-10-12 222 views 32 votes

orjson Response vs JSONResponse in practice — follow-up #12

@kai_sre
SRE

Hit this after a routine bump.

Symptom: orjson Response vs JSONResponse in practice — follow-up #12

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?

8 replies

@piotr
2026-10-12 15:59 UTC · 1 votes

dropping pool_size per worker fixed it for us on the same box size.

@yuna
2026-10-13 11:29 UTC · 1 votes

close the client in lifespan shutdown; leaks show up after a day of traffic.

@nyx_api
2026-10-14 01:13 UTC · 4 votes

measure with keep-alive on; cold connects inflate p99.

@leo_cache
2026-10-14 21:02 UTC · 3 votes

minimal repro with ASGITransport would help more than screenshots.

@leo_cache
2026-10-15 11:06 UTC · 9 votes

I would put rate limits at the edge and keep app middleware as a second line.

@oz
2026-10-16 06:50 UTC · 5 votes

measure with keep-alive on; cold connects inflate p99.

@vera_rs
2026-10-16 20:13 UTC · 5 votes

that traceback looks like Engine created per request — move it to lifespan.

@mira_py
2026-10-17 09:51 UTC · 4 votes

check proxy_read_timeout before blaming uvicorn resets.

Reply

Login or register to reply.