discussion 2026-11-10 2240 views 14 votes

When background tasks should be a queue instead — follow-up #20

@omar
Tech Lead

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?

9 replies

@ina
2026-11-11 00:48 UTC · 0 votes

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

@ina
2026-11-11 13:54 UTC · 0 votes

minimal repro with ASGITransport would help more than screenshots.

@nik
2026-11-11 16:19 UTC · 5 votes

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

@nyx_api
2026-11-12 06:24 UTC · 10 votes

marking solved after we pinned the dependency and re-smoked /docs.

@gabe
2026-11-12 23:25 UTC · 6 votes

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

@leda
2026-11-13 12:26 UTC · 9 votes

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

@seth
2026-11-14 03:35 UTC · 2 votes

orjson helped CPU a few percent; DB still the ceiling.

@raul
2026-11-14 05:19 UTC · 8 votes

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

@cleo_dev29
2026-11-14 16:09 UTC · 1 votes

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

Reply

Login or register to reply.