cgroups

8 commands

8 shown

Service memory accounting (cgroup v2) 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 #cgroups#memory#performance#troubleshooting Memory PSI pressure stall PSI: time tasks stalled on memory reclaim; rising avg10 = thrashing before OOM cat /sys/fs/cgroup/system.slice/<name>.service/memory.pressure #cgroups#memory#performance#observability CPU throttling stats (cgroup v2) Count and total usec a cgroup was CPU-throttled by cpu.max quota grep -E 'nr_throttled|throttled_usec' /sys/fs/cgroup/system.slice/<name>.service/cpu.stat #cgroups#cpu#performance#troubleshooting Read and set CPU quota (cgroup v2) cpu.max is 'quota period' in usec; 'max' = no limit. note: prefer systemctl set-property cat /sys/fs/cgroup/system.slice/<name>.service/cpu.max # "max 100000" = unlimited; "50000 100000" = 0.5 core #cgroups#cpu#performance Per-device IO pressure and stats PSI io stall plus per-major:minor rbytes/wbytes/rios; pin noisy disk neighbors cat /sys/fs/cgroup/system.slice/<name>.service/io.pressure /sys/fs/cgroup/system.slice/<name>.service/io.stat #cgroups#disk#performance#observability List PIDs in a service cgroup Every PID currently in the service slice; cross-check with systemctl status tree cat /sys/fs/cgroup/system.slice/<name>.service/cgroup.procs; systemctl status <name>.service | grep CGroup #cgroups#systemd#troubleshooting#debug Full cgroup tree with empty groups cgls --all shows empty cgroups too; cgtop ranks slices by live CPU/mem/io systemd-cgls --all --no-pager; systemd-cgtop -d 2 --depth=3 #cgroups#systemd#monitoring#performance Legacy v1 ad-hoc cgroup libcgroup v1 throwaway limit. note: v2 unified hierarchy uses systemd-run --scope -p cgcreate -g memory:/<name>; cgset -r memory.limit_in_bytes=512M <name>; cgexec -g memory:/<name> <command> #cgroups#memory#systemd
no commands match