Commit 4fbf359
fix(web): scale web heap limit to container memory (#1569)
* 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>
* docs: add changelog entry for web heap limit fix
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(web): use 50% rather than 75% for the web heap limit
At a 16GiB limit this gives the web process an 8384MiB ceiling (up from
4288MiB), which still resolves the GC thrash while leaving roughly 7.7GiB for
page cache. zoekt currently uses ~5.8GiB of file cache for its EFS-backed
index, and 75% would have squeezed that to ~3.6GiB.
50% also matches Node's own default curve below the ~4GiB cap, so deployments
at or under 8GiB are unaffected by this change.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Remove comment in supervisord configuration
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent eb46976 commit 4fbf359
2 files changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
0 commit comments