systemd-cgtop(1)
Show top control groups by their resource usage (CPU, memory, I/O).
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
| Flag | What it does |
|---|---|
-h, --help | Show help message and exit |
--version | Print version information and exit |
-p, --cpu-percent | Sort by CPU usage percentage (default behavior) |
-m, --memory | Sort by memory usage instead of CPU |
-i, --io | Sort by I/O throughput |
-b, --batch | Run in non-interactive batch mode (single snapshot to stdout) |
-n, --iterations=N | Exit after N iterations (useful with --batch) |
-d, --delay=SEC | Set refresh interval to SEC seconds (default 1) |
-k, --key=COLUMN | Sort by specified column (cpu, memory, io, tasks, path) |
--recursive=BOOL | Include or exclude recursive cgroup resource accounting (yes/no) |
Examples
Display cgroups sorted by CPU usage, updating every second interactively
systemd-cgtopShow cgroups sorted by memory consumption instead of CPU
systemd-cgtop -mSort and display cgroups by I/O throughput (read/write operations)
systemd-cgtop -iPrint a single snapshot of cgroups in batch mode and exit immediately
systemd-cgtop -b -n 1Run interactively with a 5-second refresh interval instead of the default 1 second
systemd-cgtop -d 5Display cgroups under only the system.slice cgroup hierarchy
systemd-cgtop /system.sliceCapture a single memory-sorted snapshot to a file for later review
systemd-cgtop -k memory -b > cgroup_snapshot.txt