The production backend runs uvicorn with --reload:
$ docker inspect DataSpace --format '{{.Config.Cmd}}'
[uvicorn DataSpace.asgi:application --host 0.0.0.0 --port 8000 --reload]
--reload is a development flag. It starts a file-watching supervisor that
restarts the server whenever a source file changes, and it is documented by
uvicorn as not for production use.
Why it matters here
- It disables multiple workers.
--reload and --workers are mutually
exclusive, so prod is stuck at one worker regardless of configuration. Dev now
runs two (#135).
- It watches the filesystem continuously, costing CPU and file handles for
a capability nothing in production needs.
- A stray file write restarts the auth-serving API. There are currently 12
uncommitted files in the prod checkout; anything touching them cycles the app.
Also observed on the same box
The working tree at ~/DataExchange/DataExBackend has 12 uncommitted files.
An image-based deploy would discard them silently. They need to be diffed and
either committed or consciously dropped before any pipeline work — otherwise the
first automated deploy is also an unplanned rollback of whatever they contain.
Fix
Remove --reload in the same change that introduces workers. Doing one without
the other is worse than neither: workers without removing reload has no effect,
and removing reload without workers leaves prod single-threaded.
Related: #141,
#142.
Read-only survey; nothing was changed on the box.
The production backend runs uvicorn with
--reload:--reloadis a development flag. It starts a file-watching supervisor thatrestarts the server whenever a source file changes, and it is documented by
uvicorn as not for production use.
Why it matters here
--reloadand--workersare mutuallyexclusive, so prod is stuck at one worker regardless of configuration. Dev now
runs two (#135).
a capability nothing in production needs.
uncommitted files in the prod checkout; anything touching them cycles the app.
Also observed on the same box
The working tree at
~/DataExchange/DataExBackendhas 12 uncommitted files.An image-based deploy would discard them silently. They need to be diffed and
either committed or consciously dropped before any pipeline work — otherwise the
first automated deploy is also an unplanned rollback of whatever they contain.
Fix
Remove
--reloadin the same change that introduces workers. Doing one withoutthe other is worse than neither: workers without removing reload has no effect,
and removing reload without workers leaves prod single-threaded.
Related: #141,
#142.
Read-only survey; nothing was changed on the box.