Skip to content

Commit 27310c8

Browse files
authored
Align default/staging memory config with production (7168 MiB heap, 8 Gi request) (#60309)
Align default/staging memory config with production to fix OOM crashes caused by Moda config layering applying the 4096 MiB heap limit instead of the production 7168 MiB limit.
1 parent d8ba9e3 commit 27310c8

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

config/kubernetes/default/deployments/webapp.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ spec:
2424
resources:
2525
requests:
2626
cpu: 1000m
27-
memory: 4500Mi
27+
# Absolute minimum to start app is 1000m
28+
# Node is single-threaded but we want more CPUs
29+
# for OS and image resizing, and other binary executions
30+
# Better to increase replicas or memory than CPU
31+
memory: 8.0Gi
32+
# Absolute minimum to start app is 4500Mi
33+
# Would increase with more pages, versions, or languages supported
34+
# The additional memory helps during traffic surges
2835
# Keep ~600 MB headroom above --max-old-space-size in
2936
# config/moda/configuration/default/env.yaml for Node
3037
# off-heap memory and OS overhead.

config/moda/configuration/default/env.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ data:
66
# V8 code cache, libuv) and OS overhead. If you change the memory
77
# request in config/kubernetes/default/deployments/webapp.yaml,
88
# update this value to match.
9-
# Current: 4500 MiB request, 4096 MiB heap = 404 MiB headroom
10-
NODE_OPTIONS: '--max-old-space-size=4096'
9+
# Current: 8.0 Gi (8192 MiB) request, 7168 MiB heap = 1024 MiB headroom
10+
NODE_OPTIONS: '--max-old-space-size=7168'
1111
PORT: '4000'
1212
ENABLED_LANGUAGES: 'en,es,ja,pt,zh,ru,fr,ko,de'
1313
RATE_LIMIT_MAX: '21'

0 commit comments

Comments
 (0)