Skip to content

Commit c2eddf2

Browse files
committed
install-debian.sh: set vm.overcommit_memory=1 for Redis
Write /etc/sysctl.d/60-redis.conf and apply immediately with sysctl -p. Prevents Redis (and member-manager-redis, event-manager-redis, etc.) from warning about background save failures under low memory conditions. Made-with: Cursor
1 parent c6a784c commit c2eddf2

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

bin/install-debian.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ sudo tee /etc/docker/daemon.json > /dev/null <<EOF
5454
"data-root": "${DOCKER_DATA_ROOT}",
5555
5656
"default-address-pools": [
57-
{ "base": "172.17.0.0/16", "size": 24 }
57+
{ "base": "172.17.0.0/12", "size": 24 }
5858
],
5959
6060
"log-driver": "journald",
@@ -66,6 +66,19 @@ EOF
6666

6767
echo "Docker daemon configured (data-root: $DOCKER_DATA_ROOT)."
6868

69+
# ── Kernel: enable memory overcommit (required for Redis) ────────────────────
70+
echo "Configuring vm.overcommit_memory for Redis..."
71+
72+
sudo tee /etc/sysctl.d/60-redis.conf > /dev/null <<'EOF'
73+
# Allow memory overcommit so Redis background saves and replication don't fail
74+
# under low-memory conditions. Required by Redis (and jemalloc).
75+
# See: https://github.com/jemalloc/jemalloc/issues/1328
76+
vm.overcommit_memory = 1
77+
EOF
78+
79+
sudo sysctl -q -p /etc/sysctl.d/60-redis.conf
80+
echo "vm.overcommit_memory=1 applied."
81+
6982
# ── journald: volatile (in-memory) storage capped at 256 MB ──────────────────
7083
echo "Configuring journald for in-memory Docker logging..."
7184

0 commit comments

Comments
 (0)