$linuxjunkies
>

systemd-cgtop(1)

Show top control groups by their resource usage (CPU, memory, I/O).

UbuntuDebianFedoraArch

Synopsis

systemd-cgtop [OPTIONS] [GROUP]

Description

systemd-cgtop displays an interactive top-like view of the Linux control groups (cgroups) hierarchy, showing resource consumption such as CPU time, memory usage, and I/O operations. It helps identify which services and processes are consuming the most system resources.

The display updates in real-time and can be sorted by different metrics. It requires root privileges or appropriate cgroup permissions to display all control groups on the system.

Common options

FlagWhat it does
-h, --helpShow help message and exit
--versionPrint version information and exit
-p, --cpu-percentSort by CPU usage percentage (default behavior)
-m, --memorySort by memory usage instead of CPU
-i, --ioSort by I/O throughput
-b, --batchRun in non-interactive batch mode (single snapshot to stdout)
-n, --iterations=NExit after N iterations (useful with --batch)
-d, --delay=SECSet refresh interval to SEC seconds (default 1)
-k, --key=COLUMNSort by specified column (cpu, memory, io, tasks, path)
--recursive=BOOLInclude or exclude recursive cgroup resource accounting (yes/no)

Examples

Display cgroups sorted by CPU usage, updating every second interactively

systemd-cgtop

Show cgroups sorted by memory consumption instead of CPU

systemd-cgtop -m

Sort and display cgroups by I/O throughput (read/write operations)

systemd-cgtop -i

Print a single snapshot of cgroups in batch mode and exit immediately

systemd-cgtop -b -n 1

Run interactively with a 5-second refresh interval instead of the default 1 second

systemd-cgtop -d 5

Display cgroups under only the system.slice cgroup hierarchy

systemd-cgtop /system.slice

Capture a single memory-sorted snapshot to a file for later review

systemd-cgtop -k memory -b > cgroup_snapshot.txt

Related commands