Skip to content

Commit 40d6748

Browse files
Ho1yShifclaude
andcommitted
fix(render): honor WEB_CONCURRENCY for worker count
Render auto-sets WEB_CONCURRENCY based on the instance's CPU/memory (1 on the free tier). Hardcoding --workers 4 caused workers to be OOM-killed on the free tier — the parent kept respawning replacements, producing a steady stream of "Child process died" messages and wasted resources. Default to 1 if WEB_CONCURRENCY is unset. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 58a36a0 commit 40d6748

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/scripts/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22
set -e
33
bash scripts/prestart.sh
4-
exec fastapi run --workers 4 --host 0.0.0.0 --port "$PORT" app/main.py
4+
exec fastapi run --workers "${WEB_CONCURRENCY:-1}" --host 0.0.0.0 --port "$PORT" app/main.py

0 commit comments

Comments
 (0)