Skip to content

Commit 3ee3c2b

Browse files
Merge pull request #146 from CodeForPhilly/chore/lower-memory-limits
chore(deploy): lower memory limits after gitsheets 1.4.1 heap fix
2 parents e97728c + 4f6525f commit 3ee3c2b

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

deploy/kustomize/base/configmap.yaml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,16 @@ data:
1919
NODE_ENV: "production"
2020
# Bump Node's old-space heap ceiling above the default (~400Mi on Linux
2121
# containers) so the in-memory record set + secondary indices + FTS fit.
22-
# Keep ~25% headroom below the container's memory limit for ephemeral
23-
# work (request handling, gitsheets tree mutations, etc.).
2422
#
25-
# 2048 (was 1536): a fresh boot rebuilding in-memory state from the full
26-
# `published` import (~31.8k people + ~10.4k tag-assignments + secondary
27-
# indices) OOM'd at the 1536 ceiling. The native FTS5 store is off-heap;
28-
# the V8 heap holds the record maps + indices. 2048 boots cleanly and runs
29-
# stable; it is deliberately kept modest because these nodes are only
30-
# ~3.9Gi — an earlier 3072/3.5Gi trial let the pod grow until it starved
31-
# the node's kubelet (NodeNotReady). See the memory-optimization issue for
32-
# the (suspiciously large ~60x) on-disk-to-heap expansion worth reducing.
33-
NODE_OPTIONS: "--max-old-space-size=2048"
23+
# 512 (was 2048): gitsheets 1.4.1 switched the TOML parser to smol-toml,
24+
# fixing the #132 heap blowup at its root (@iarna's parser pinned ~12x each
25+
# record's source in V8 sliced/cons-strings). A full boot from the
26+
# `published` import now measures ~123Mi heap / ~321Mi RSS (FTS5 is off-heap
27+
# and tiny, ~40Mi). 512 is ~4x the measured boot heap — ample for request
28+
# handling + gitsheets tree mutations — while leaving the node (~3.9Gi) most
29+
# of its memory back. The earlier 2048/2.5Gi was sized for the leak, not the
30+
# real working set.
31+
NODE_OPTIONS: "--max-old-space-size=512"
3432
PORT: "3001"
3533
STORAGE_BACKEND: "filesystem"
3634
# The runtime-served branch. `published` is the long-term sandbox + prod

deploy/kustomize/base/deployment.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,21 @@ spec:
6464
resources:
6565
requests:
6666
cpu: 100m
67-
memory: 1Gi
67+
# ~321Mi measured steady-state RSS (full `published` import +
68+
# indices + FTS) with gitsheets 1.4.1; request sits above that.
69+
memory: 512Mi
6870
limits:
6971
cpu: 1000m
7072
# Holds the full public dataset + secondary indices + FTS in
7173
# memory (~31.8k people, 268 projects, 10.4k tag-assignments, …).
72-
# 2.5Gi (was 2Gi): a cold boot rebuilding state from the full
73-
# `published` import exceeded the prior 1536Mi heap; raised to
74-
# NODE_OPTIONS=--max-old-space-size=2048 (see configmap.yaml),
75-
# with the container limit just above that for the off-heap FTS5
76-
# store + ephemeral request work. Kept at 2.5Gi (not higher) so
77-
# a single pod can't starve a node — these nodes are only ~3.9Gi
78-
# and a 3.5Gi trial drove one NodeNotReady. ~1.4Gi node headroom.
79-
memory: 2560Mi
74+
# 1Gi (was 2.5Gi): gitsheets 1.4.1's smol-toml parser fixed the
75+
# #132 heap blowup — a full boot now measures ~123Mi heap /
76+
# ~321Mi RSS (vs >500Mi heap before). With the heap ceiling at
77+
# NODE_OPTIONS=--max-old-space-size=512 (see configmap.yaml), 1Gi
78+
# gives ~3x the steady RSS for heap-ceiling growth + off-heap FTS5
79+
# + ephemeral request work, and hands the ~3.9Gi node ~1.5Gi back
80+
# vs the old 2.5Gi limit.
81+
memory: 1Gi
8082
securityContext:
8183
runAsNonRoot: true
8284
runAsUser: 1000

0 commit comments

Comments
 (0)