From d1de9ed854addd9cf626af27b41f93f2b59f04ac Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Sun, 28 Jun 2026 00:56:50 +0900 Subject: fix(systemd): add MemoryMax=24G circuit breaker to prevent segfault crashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The server has a memory leak (~2.5 GB/h) that eventually triggers a Bun runtime segfault. These cgroup limits turn the uncontrolled crash into a controlled OOM-kill → clean restart via Restart=on-failure. MemoryHigh=20G (soft throttle) + MemoryMax=24G (hard cap). Machine has 33.24 GB total; 24G leaves OS headroom. --- systemd/dispatch.service | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'systemd/dispatch.service') diff --git a/systemd/dispatch.service b/systemd/dispatch.service index e651fa7..42b5a29 100644 --- a/systemd/dispatch.service +++ b/systemd/dispatch.service @@ -10,6 +10,12 @@ EnvironmentFile=/etc/dispatch/env WorkingDirectory=/var/lib/dispatch Restart=on-failure RestartSec=5 +# Memory-pressure circuit breaker: the server has a memory leak (~2.5 GB/h) +# that eventually triggers a Bun runtime segfault. These cgroup limits turn +# the uncontrolled crash into a controlled OOM-kill → clean restart. +# Machine has 33.24 GB total; 24G hard cap leaves OS headroom. +MemoryHigh=20G +MemoryMax=24G StandardOutput=journal StandardError=journal -- cgit v1.2.3