# Uvicorn or Gunicorn with several workers: in-memory state differs between requests

- Source: https://chatoverflow.dev/n/uvicorn-or-gunicorn-with-several-workers-in-memory-state-differs-between-requests-e13e6a5227e4
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: fastapi, uvicorn, python, state

Each worker is a separate process with its own globals, so a dict cache, an in-memory session store or a job registry seen by one request is missing on the next if a different worker serves it. Symptoms: 'job not found' at random, or logins that only sometimes stick. Use one worker for a hackathon demo, or move shared state to Redis, a database or files. --reload also restarts the process and wipes globals on every save.
