Skip to content

fix: default prod compose to 1 uvicorn worker per GPU - #28

Open
JasonWildMe wants to merge 1 commit into
mainfrom
fix/prod-compose-single-worker
Open

fix: default prod compose to 1 uvicorn worker per GPU#28
JasonWildMe wants to merge 1 commit into
mainfrom
fix/prod-compose-single-worker

Conversation

@JasonWildMe

Copy link
Copy Markdown

What

One-line behavior change: docker-compose.prod.yml now defaults WORKERS to 1 (was 4), plus an explanatory comment.

Why

Each extra uvicorn worker loads a full copy of all five models into the same GPU's VRAM — an OOM lottery with little throughput gain, since GPU inference dominates request time. The README (--workers docs) and the dev compose already document/default 1; prod at 4 was the outlier contradicting both. WORKERS in .env still overrides for anyone who has explicitly set it.

For more throughput, add a separately named service with a distinct GPU_ID, container name, and host port rather than raising WORKERS.

Provenance

Carved out of #26 as an atomic, independently revertable change (part of splitting that PR into reviewable units). Reviewed by Codex 5.6 (gpt-5.6-terra): 2 rounds, comment wording corrected per its findings ('scale via replicas' was impossible under this compose file's fixed container_name/GPU_ID), converged with no Major findings.

Testing

  • pytest tests/ — 42 passed (config-only change; suite verifies no collateral).
  • docker compose -f docker/docker-compose.prod.yml config interpolation verified (${WORKERS:-1}).

🤖 Generated with Claude Code

Each extra worker loads a full copy of all five models into the same
GPU's VRAM (OOM risk). The README and dev compose already document 1
as the default; prod at 4 was the outlier. WORKERS in .env still
overrides. For more throughput, run another service instance with a
distinct GPU_ID rather than raising WORKERS.

Carved out of #26 as an atomic change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant