Skip to content

Commit 22aec53

Browse files
fix(web): scale web heap limit to container memory
Node's default old-space limit caps at ~4GiB regardless of how much memory the container actually has. On larger deployments the web process fills that ceiling and V8 falls into back-to-back full mark-compact collections, which block the event loop for seconds at a time and slow every route at once. Set --max-old-space-size-percentage on the web program so the heap scales with the container's memory limit. Node reads the cgroup limit, so this is proportional on every deployment size. Scoped to [program:web] via supervisord so the backend and zoekt are unaffected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent eb46976 commit 22aec53

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

supervisord.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ redirect_stderr=true
1515

1616
[program:web]
1717
command=./prefix-output.sh node packages/web/server.js
18+
# Node's default heap limit caps at ~4GiB regardless of container memory.
19+
environment=NODE_OPTIONS="--max-old-space-size-percentage=75"
1820
priority=20
1921
autostart=true
2022
autorestart=true

0 commit comments

Comments
 (0)