Show per-service resource usage with systemd-cgtop

Find which systemd service eats CPU, memory or I/O, grouped by control group instead of raw process.

LinuxcgroupsmonitoringsystemdLow risk
Run systemd-cgtop --order=cpu --depth=2 to watch resource use per cgroup, ordered by CPU, like top but for services.

01Command

Command
$ systemd-cgtop --order=cpu --depth=2

02What it does

top shows individual processes, but a browser spawns dozens of them and a service may fork workers. systemd-cgtop aggregates usage by control group, so all processes of docker.service or user.slice appear as one line. Press m or i to sort by memory or I/O, and 1 to see individual tasks instead of groups.

03Risk

RiskLow risk
Requirementssystemd-based distro (Ubuntu, Debian, Fedora, Arch). Read-only; no root needed. Accounting must be enabled for some counters, most distros enable CPU accounting by default.
!Warning: Memory and I/O accounting may be disabled by default on some distros; those columns show zero until you set MemoryAccounting=yes / IOAccounting=yes in systemd's system.conf or the unit. The command keeps running until you press q.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • systemd-cgtop(1) — Debian bookworm
    Debian Manpages · community · 2026-09-17
    Evidence: Same synopsis systemd-cgtop [OPTIONS...]; describes ordering by CPU, memory or I/O load and the --depth= cut-off.
  • systemd-cgtop(1) - Linux manual page
    man7.org · community · 2026-09-17
    Evidence: Documents systemd-cgtop [OPTIONS...] with options --order=, --depth=, -P, -m showing task/CPU/memory/I/O usage per control group.

Last verified: 2026-09-19 · Category: System & Settings

06Related solutions