Linux systemd and cgroup v2 RAM limits

Limit Linux Service RAM with systemd and cgroup v2

Everyone who has run Linux servers for a while has lived through some version of this incident: one service — a leaky app, a batch job, a runaway query — grows until the whole host starts thrashing, and by the time the OOM killer wakes up, it kills something you cared about more than the actual culprit. The zram and zswap work from part 2 protects you from peaks, but it does nothing against this. Compression buys headroom; it doesn’t assign blame. ...