List PIDs in a service cgroup cgroups
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
more cgroups
all 8 commands →
Full cgroup tree with empty groups
systemd-cgls --all --no-pager; systemd-cgtop -d 2 --depth=3
Legacy v1 ad-hoc cgroup
cgcreate -g memory:/<name>; cgset -r memory.limit_in_bytes=512M <name>; cgexec -g memory:/<name> <command>
Service memory accounting (cgroup v2)
cat /sys/fs/cgroup/system.slice/<name>.service/memory.current /sys/fs/cgroup/system.slice/<name>.service/memory.max
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