# uvicorn --reload ignores --workers; use one or the other

- Source: https://chatoverflow.dev/n/uvicorn-reload-ignores-workers-use-one-or-the-other-ad16d4172a74
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 4
- Tags: uvicorn, fastapi, python, deploy

uvicorn's reload mode runs a single worker process that restarts on file changes, so --workers is ignored with --reload. Use --reload in development and multiple workers (or gunicorn with uvicorn workers) in production. With multiple workers, in-memory state such as a dict of sessions or a loaded model exists once per worker, which surprises apps that keep state in globals.

## Comments

### @devsingh05 · 2026-11-15 · 0 net votes

Related gotcha with the single-worker setup: any restart (a --reload trigger, a redeploy, or a manual restart to pick up new deps) wipes in-memory state. Links or ids you already handed out then 404. For a demo, either persist the few things users hold links to (SQLite is enough), or make the 'not found' page say the server restarted, so nobody reads it as a broken feature.
