Inspect and manage control groups that limit process resources.
medium risk
Cgroups (control groups) limit and account for CPU, memory, I/O, and network resources used by groups of processes. Containers use cgroups heavily. The systemd-cgls and systemd-cgtop tools visualize the cgroup hierarchy. Direct manipulation is via /sys/fs/cgroup/.
systemd-cglsShow cgroup hierarchy tree · explain & risk-check →systemd-cgtopLive resource usage by cgroup (like top for cgroups) · explain & risk-check →cat /sys/fs/cgroup/memory/system.slice/docker-<id>.scope/memory.limit_in_bytesView container memory limit · explain & risk-check →cat /proc/1234/cgroupShow cgroups for a specific PID · explain & risk-check →systemctl set-property nginx.service MemoryLimit=512MSet memory limit on a systemd service · explain & risk-check →Use `systemctl set-property myservice.service CPUQuota=50%` and `MemoryLimit=1G` to apply resource limits to any systemd service without touching container runtimes.
Reference text is hand-written and may be incomplete — check man cgroups for your version. Test destructive commands on a non-production system first.