fix(api): let node size its heap from the container limit (#2236)

This commit is contained in:
Hampus
2026-08-31 14:09:13 +02:00
committed by GitHub
parent 7b9284edb9
commit 8476595507
3 changed files with 9 additions and 9 deletions
+6 -6
View File
@@ -79,12 +79,12 @@ FLUXER_DISCOVERY_ENABLED=true
#FLUXER_GATEWAY_MEMORY_LIMIT=1gb
#FLUXER_MEILISEARCH_MEMORY_LIMIT=768mb
# The Node heap ceiling must stay below the container limit above, with room to
# spare: V8 adds roughly 200 MB of semi-space on top of the value set here, and
# buffers live outside the heap entirely. Around 70 percent of the container limit
# is a safe ratio. If the heap ceiling exceeds the container limit, the kernel
# OOM-kills the container (exit 137, no diagnostics) instead of Node reporting a
# JavaScript heap out of memory error you can act on.
# Node sizes its own heap from the container memory limit by default, at roughly
# 55 percent of it, which always leaves room for the buffers and stacks that live
# outside the heap. Leave these unset unless you have a reason to pin the value.
# Any value set here must stay well below the container limit above: a heap ceiling
# above the container limit makes the kernel OOM-kill the container (exit 137, no
# diagnostics) instead of Node reporting a JavaScript heap out of memory error.
#FLUXER_API_NODE_HEAP_MB=1792
#FLUXER_WORKER_NODE_HEAP_MB=1792
+2 -2
View File
@@ -293,7 +293,7 @@ services:
environment:
<<: *fluxer-env
FLUXER_API_PORT: "8080"
NODE_OPTIONS: --max-old-space-size=${FLUXER_API_NODE_HEAP_MB:-1792} --enable-source-maps
NODE_OPTIONS: --enable-source-maps${FLUXER_API_NODE_HEAP_MB:+ --max-old-space-size=$FLUXER_API_NODE_HEAP_MB}
FLUXER_API_PRESIGNED_ATTACHMENT_UPLOADS_ENABLED: "true"
FLUXER_POSTGRES_MAX_CONNECTIONS: "25"
healthcheck:
@@ -331,7 +331,7 @@ services:
command: ["node", "dist/WorkerEntrypoint.js"]
environment:
<<: *fluxer-env
NODE_OPTIONS: --max-old-space-size=${FLUXER_WORKER_NODE_HEAP_MB:-1792} --enable-source-maps
NODE_OPTIONS: --enable-source-maps${FLUXER_WORKER_NODE_HEAP_MB:+ --max-old-space-size=$FLUXER_WORKER_NODE_HEAP_MB}
FLUXER_API_WORKER_MODE: all_lanes
FLUXER_API_WORKER_ENABLE_CRON_SCHEDULER: "true"
FLUXER_API_WORKER_ENABLE_VOICE_RECONCILIATION: "true"
+1 -1
View File
@@ -59,7 +59,7 @@ RUN rm -rf pkgs && \
ENV HOME=/usr/src/app
ENV COREPACK_HOME=/usr/src/app/.cache/corepack
ENV NODE_ENV=production
ENV NODE_OPTIONS="--max-old-space-size=2048 --enable-source-maps"
ENV NODE_OPTIONS="--enable-source-maps"
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
ENV BUILD_VERSION=${BUILD_VERSION}