fix: raise Node heap cap to 512MB and bump pod memory limit #838

Merged
argoyle merged 1 commits from bump-wgc-memory into main 2026-05-19 05:20:36 +00:00
Owner

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 itself 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

With an empty cosmoRouterConfig, callers of latestSchema(ref) get nothing — visible to the shiny gateway as it switches to consuming the pre-composed config straight from the schemas service.

Changes

  • Dockerfile: bump NODE_OPTIONS=--max-old-space-size 64 → 512.
  • k8s/deploy.yaml: bump container memory request 20Mi → 128Mi and add a 768Mi limit. The Dockerfile env covers the Node heap, so drop the manifest's NODE_OPTIONS override.

The live k8s.unbound.se cluster was already patched in place via kubectl set env + kubectl set resources; this commit makes the manifest match (and removes the env override since the new image will carry the higher cap by default).

Test plan

  • After rollout, latestSchema(ref: "Shiny@prod") returns a non-empty cosmoRouterConfig.
  • Pod memory stays well below 768Mi at idle.
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` itself 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 ``` With an empty `cosmoRouterConfig`, callers of `latestSchema(ref)` get nothing — visible to the shiny gateway as it switches to consuming the pre-composed config straight from the schemas service. ## Changes - `Dockerfile`: bump `NODE_OPTIONS=--max-old-space-size` 64 → 512. - `k8s/deploy.yaml`: bump container memory request 20Mi → 128Mi and add a 768Mi limit. The Dockerfile env covers the Node heap, so drop the manifest's NODE_OPTIONS override. The live `k8s.unbound.se` cluster was already patched in place via `kubectl set env` + `kubectl set resources`; this commit makes the manifest match (and removes the env override since the new image will carry the higher cap by default). ## Test plan - [ ] After rollout, `latestSchema(ref: "Shiny@prod")` returns a non-empty `cosmoRouterConfig`. - [ ] Pod memory stays well below 768Mi at idle.
argoyle scheduled this pull request to auto merge when all checks succeed 2026-05-19 04:56:43 +00:00
argoyle added 1 commit 2026-05-19 04:56:44 +00:00
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
921d4e39fa
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.
argoyle force-pushed bump-wgc-memory from f3f96c59a1 to 921d4e39fa 2026-05-19 04:56:44 +00:00 Compare
argoyle merged commit c4829cf280 into main 2026-05-19 05:20:36 +00:00
argoyle deleted branch bump-wgc-memory 2026-05-19 05:20:37 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unboundsoftware/schemas#838