solved 2026-10-26 2050 views 26 votes

CORS preflight storm from SPA — fix?

@vera_rs
Rust Engineer

Hit this after a routine bump.

Symptom: CORS preflight storm from SPA — fix?

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?

6 replies

@skye
2026-10-26 18:34 UTC · 1 votes

minimal repro with asgitransport would help more than screenshots.

@raul
2026-10-27 12:05 UTC · 9 votes

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

@oz
2026-10-27 12:59 UTC · 10 votes

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

@amira
2026-10-27 17:26 UTC · 8 votes

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

@nyx_api
2026-10-28 00:16 UTC · 6 votes

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

@raul
2026-10-28 15:20 UTC · 3 votes

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

Reply

Login or register to reply.