Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions deploy/kustomize/base/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ data:
NODE_ENV: "production"
# Bump Node's old-space heap ceiling above the default (~400Mi on Linux
# containers) so the in-memory record set + secondary indices + FTS fit.
# Keep ~25% headroom below the container's memory limit for ephemeral
# work (request handling, gitsheets tree mutations, etc.).
#
# 2048 (was 1536): a fresh boot rebuilding in-memory state from the full
# `published` import (~31.8k people + ~10.4k tag-assignments + secondary
# indices) OOM'd at the 1536 ceiling. The native FTS5 store is off-heap;
# the V8 heap holds the record maps + indices. 2048 boots cleanly and runs
# stable; it is deliberately kept modest because these nodes are only
# ~3.9Gi — an earlier 3072/3.5Gi trial let the pod grow until it starved
# the node's kubelet (NodeNotReady). See the memory-optimization issue for
# the (suspiciously large ~60x) on-disk-to-heap expansion worth reducing.
NODE_OPTIONS: "--max-old-space-size=2048"
# 512 (was 2048): gitsheets 1.4.1 switched the TOML parser to smol-toml,
# fixing the #132 heap blowup at its root (@iarna's parser pinned ~12x each
# record's source in V8 sliced/cons-strings). A full boot from the
# `published` import now measures ~123Mi heap / ~321Mi RSS (FTS5 is off-heap
# and tiny, ~40Mi). 512 is ~4x the measured boot heap — ample for request
# handling + gitsheets tree mutations — while leaving the node (~3.9Gi) most
# of its memory back. The earlier 2048/2.5Gi was sized for the leak, not the
# real working set.
NODE_OPTIONS: "--max-old-space-size=512"
PORT: "3001"
STORAGE_BACKEND: "filesystem"
# The runtime-served branch. `published` is the long-term sandbox + prod
Expand Down
20 changes: 11 additions & 9 deletions deploy/kustomize/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,21 @@ spec:
resources:
requests:
cpu: 100m
memory: 1Gi
# ~321Mi measured steady-state RSS (full `published` import +
# indices + FTS) with gitsheets 1.4.1; request sits above that.
memory: 512Mi
limits:
cpu: 1000m
# Holds the full public dataset + secondary indices + FTS in
# memory (~31.8k people, 268 projects, 10.4k tag-assignments, …).
# 2.5Gi (was 2Gi): a cold boot rebuilding state from the full
# `published` import exceeded the prior 1536Mi heap; raised to
# NODE_OPTIONS=--max-old-space-size=2048 (see configmap.yaml),
# with the container limit just above that for the off-heap FTS5
# store + ephemeral request work. Kept at 2.5Gi (not higher) so
# a single pod can't starve a node — these nodes are only ~3.9Gi
# and a 3.5Gi trial drove one NodeNotReady. ~1.4Gi node headroom.
memory: 2560Mi
# 1Gi (was 2.5Gi): gitsheets 1.4.1's smol-toml parser fixed the
# #132 heap blowup — a full boot now measures ~123Mi heap /
# ~321Mi RSS (vs >500Mi heap before). With the heap ceiling at
# NODE_OPTIONS=--max-old-space-size=512 (see configmap.yaml), 1Gi
# gives ~3x the steady RSS for heap-ceiling growth + off-heap FTS5
# + ephemeral request work, and hands the ~3.9Gi node ~1.5Gi back
# vs the old 2.5Gi limit.
memory: 1Gi
securityContext:
runAsNonRoot: true
runAsUser: 1000
Expand Down