Skip to content

Commit bf69e09

Browse files
heiskrCopilot
andauthored
Document heap vs memory request relationship in config comments (#60248)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9d6e621 commit bf69e09

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

config/kubernetes/default/deployments/webapp.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ spec:
2525
requests:
2626
cpu: 1000m
2727
memory: 4500Mi
28+
# Keep ~600 MB headroom above --max-old-space-size in
29+
# config/moda/configuration/default/env.yaml for Node
30+
# off-heap memory and OS overhead.
2831
limits:
2932
cpu: 8000m
3033
memory: 16Gi

config/kubernetes/production/deployments/webapp.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ spec:
3434
# Absolute minimum to start app is 4500Mi
3535
# Would increase with more pages, versions, or languages supported
3636
# The additional memory helps during traffic surges
37+
# Keep ~600 MB headroom above --max-old-space-size in
38+
# config/moda/configuration/production/env.yaml for Node
39+
# off-heap memory and OS overhead.
3740
limits:
3841
cpu: 16000m
3942
memory: 16Gi

config/moda/configuration/default/env.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
data:
22
MODA_APP_NAME: docs-internal
33
NODE_ENV: production
4+
# V8 heap limit (--max-old-space-size) should leave at least ~600 MiB
5+
# below the K8s memory request for Node off-heap memory (Buffers,
6+
# V8 code cache, libuv) and OS overhead. If you change the memory
7+
# request in config/kubernetes/default/deployments/webapp.yaml,
8+
# update this value to match.
9+
# Current: 4500 MiB request, 4096 MiB heap = 404 MiB headroom
410
NODE_OPTIONS: '--max-old-space-size=4096'
511
PORT: '4000'
612
ENABLED_LANGUAGES: 'en,es,ja,pt,zh,ru,fr,ko,de'

config/moda/configuration/production/env.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
data:
22
MODA_APP_NAME: docs-internal
33
NODE_ENV: production
4+
# V8 heap limit (--max-old-space-size) should leave at least ~600 MiB
5+
# below the K8s memory request for Node off-heap memory (Buffers,
6+
# V8 code cache, libuv) and OS overhead. If you change the memory
7+
# request in config/kubernetes/production/deployments/webapp.yaml,
8+
# update this value to match.
9+
# Current: 8.0 Gi (8192 MiB) request, 7168 MiB heap = 1024 MiB headroom
410
NODE_OPTIONS: '--max-old-space-size=7168'
511
PORT: '4000'
612
ENABLED_LANGUAGES: 'en,es,ja,pt,zh,ru,fr,ko,de'

0 commit comments

Comments
 (0)