Run one uvicorn worker instead of two #146
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
CrowderSoup/vTodo!146
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/one-web-worker"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #144. Drops the web role from two uvicorn workers to one.
Why
After #144, the measured savings were smaller than expected: ~26 MB PSS locally (287 → 261 MB), plus the old mcp container's
uv runwrapper on the droplet. uvicorn starts extra workers withspawn, so each one loads its own full copy of Django and the MCP server (~115 MB each). Gunicorn's forked workers shared most of that memory.One ASGI process already runs requests side by side (async, with sync views and MCP tools on threads), and vTodo serves a few requests a minute. With one worker, uvicorn also skips its supervisor and the multiprocessing resource tracker.
Change
Dockerfile:WEB_WORKERSdefaults to1.README.mdand the DB pool comment inconfig/settings.pynow say 1.WEB_WORKERS=2in the env brings the second worker back if it's ever needed.After deploying
Check
docker statsfor vtodo-web, and compare latency in the kamal-proxy logs against the numbers from #144 (POST /mcpp50 34 ms;/api/v1/tasks/p50 ~59 ms).🤖 Generated with Claude Code