fix: default prod compose to 1 uvicorn worker per GPU - #28
Open
JasonWildMe wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
One-line behavior change:
docker-compose.prod.ymlnow defaultsWORKERSto 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 (
--workersdocs) and the dev compose already document/default 1; prod at 4 was the outlier contradicting both.WORKERSin.envstill 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 raisingWORKERS.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 configinterpolation verified (${WORKERS:-1}).🤖 Generated with Claude Code