Service memory accounting (cgroup v2) cgroups
Live RSS vs hard limit for a systemd service; current near max = imminent OOM
cat /sys/fs/cgroup/system.slice/<name>.service/memory.current /sys/fs/cgroup/system.slice/<name>.service/memory.max
more cgroups
all 8 commands →
Memory PSI pressure stall
cat /sys/fs/cgroup/system.slice/<name>.service/memory.pressure
CPU throttling stats (cgroup v2)
grep -E 'nr_throttled|throttled_usec' /sys/fs/cgroup/system.slice/<name>.service/cpu.stat
Read and set CPU quota (cgroup v2)
cat /sys/fs/cgroup/system.slice/<name>.service/cpu.max # "max 100000" = unlimited; "50000 100000" = 0.5 core
Per-device IO pressure and stats
cat /sys/fs/cgroup/system.slice/<name>.service/io.pressure /sys/fs/cgroup/system.slice/<name>.service/io.stat
List PIDs in a service cgroup
cat /sys/fs/cgroup/system.slice/<name>.service/cgroup.procs; systemctl status <name>.service | grep CGroup