fix: raise Node heap cap to 512MB and bump pod memory limit
schemas / vulnerabilities (pull_request) Successful in 2m10s
schemas / check (pull_request) Successful in 2m59s
schemas / check-release (pull_request) Successful in 3m35s
pre-commit / pre-commit (pull_request) Successful in 6m43s
schemas / build (pull_request) Successful in 17m35s
schemas / deploy-prod (pull_request) Has been skipped

The Dockerfile's NODE_OPTIONS=--max-old-space-size=64 was added to keep
idle Node memory low, but in practice it OOMs wgc router compose as soon
as the supergraph has more than a handful of subgraphs:

  FATAL ERROR: Ineffective mark-compacts near heap limit
  Allocation failed - JavaScript heap out of memory

Bake the higher cap into the image and raise the container memory limit
(k8s/deploy.yaml) so the cgroup doesn't kill the pod at the new ceiling.
Memory request stays modest so the pod still schedules tightly when idle.

The live k8s.unbound.se cluster was already patched in place (kubectl
set env + set resources). This commit makes the manifest match.
This commit is contained in:
2026-05-19 06:54:22 +02:00
parent 7dddc70eda
commit 921d4e39fa
2 changed files with 7 additions and 3 deletions
+4 -2
View File
@@ -30,8 +30,10 @@ ENV TZ Europe/Stockholm
# Install wgc CLI globally for Cosmo Router composition
RUN npm install -g wgc@latest
# Cap Node.js heap for runtime wgc invocations to prevent OOM
ENV NODE_OPTIONS="--max-old-space-size=64"
# Cap Node.js heap for runtime wgc invocations. 512MB leaves room for
# composing supergraphs with many subgraphs; lower caps (e.g. 64MB) OOM
# wgc as the subgraph count grows.
ENV NODE_OPTIONS="--max-old-space-size=512"
# Copy timezone data and certificates
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
+3 -1
View File
@@ -43,7 +43,9 @@ spec:
resources:
requests:
cpu: "20m"
memory: "20Mi"
memory: "128Mi"
limits:
memory: "768Mi"
livenessProbe:
httpGet:
path: /health/live