Repository navigation
dev2/memory-guard.sh: stop agent work from OOM-killing production - #187
Merged
Merged
Conversation
…om the OOM killer 2026-10-19 12:29 UTC dev2 OOM: agent work peaked 38 GB (user-1001.slice) + 23 GB (cron.service) on a 91 GB box; the kernel killed a supabase-db backend and the Moshpit registry/relay went down ~6 min. earlyoom's --avoid ^postgres never matched '.postgres-wrapp'. Root runs this once: cgroup caps (user-1001 28/32G, cron 14/16G), oom_score_adj -900 on every db container via a 5-min timer, earlyoom avoid fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan33 finding(s) HIGH/CRITICAL: 7 | MEDIUM: 12 | LOW: 14
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause of the 2026-10-19 12:29 UTC outage (Moshpit registry + every .pit.world down ~6 min): dev2 ran out of memory. Agent work peaked at 38 GB in user-1001.slice plus 23 GB in cron.service (swap 16/16 GB full); the kernel OOM-killed a backend of the shared supabase-db Postgres. earlyoom killed 170 tiny processes and never protected Postgres (its
--avoid ^postgresmisses the container's.postgres-wrapp).The script (run once as root) caps agent memory in its own cgroups, pins every database container's oom_score_adj at -900 (timer re-applies every 5 min), and fixes earlyoom's avoid list. Idempotent, with undo steps printed.
🤖 Generated with Claude Code