SYSTEMD-CGTOP(1)
๐ SYSTEMD-CGTOP ๐
okay bestie, welcome to systemd-cgtop โ the manual page, but make it cute.
โจ NAME โจ
systemd-cgtop โ show top control groups by their resource usage ๐
๐ธ SYNOPSIS ๐ธ
systemd-cgtop [OPTIONS...] [GROUP]
๐ฆ DESCRIPTION ๐ฆ
So systemd-cgtop shows you the top control groups of your local Linux control group hierarchy, sorted by their CPU, memory, or disk I/O load. It refreshes on a regular interval (by default every 1s), and the vibe is very top(1)-core, honestly. And if you pass a control group path, it shows you only the services of that specified control group. slay.
Now, plot twist: if systemd-cgtop is not connected to a tty, it prints no column headers and by default it only runs one single iteration. The --iterations= argument, if you give it one, is still honored. This mode is literally made for scripting, no cap. ๐ฅ๏ธ
Resource usage is only accounted for control groups with the appropriate controllers turned on: the "memory" controller for memory usage, and the "io" controller for disk I/O consumption. So if you actually need resource monitoring for these things, it is recommended that you add the MemoryAccounting=1 and IOAccounting=1 settings in the unit files in question. Go read systemd.resource-control(5) for the details, bestie. ๐
The CPU load value can be between 0 and 100 times the number of processors your system has. Like, say your system has 8 processors โ then the CPU load value is gonna be between 0% and 800%. The number of processors can be found in /proc/cpuinfo. math is mathing โจ
And to emphasize, because this part matters: unless "MemoryAccounting=1" and "IOAccounting=1" are enabled for the services in question, no resource accounting will be available for system services and the data shown by systemd-cgtop will be incomplete. ๐
๐ OPTIONS ๐
The following options are understood:
-p,--order=pathโ order by control group path name.-t,--order=tasksโ order by number of tasks/processes in the control group.-c,--order=cpuโ order by CPU load.-m,--order=memoryโ order by memory usage.-i,--order=ioโ order by disk I/O load.-b,--batchโ run in "batch" mode: it does not accept input and runs until the iteration limit set with--iterations=is exhausted or until killed. This mode could be useful for sending output fromsystemd-cgtopto other programs or to a file.
Added in version 188.
-r,--rawโ format byte counts (as in memory usage and I/O metrics) and CPU time with raw numeric values rather than human-readable numbers.
Added in version 221.
--cpu=percentage,--cpu=timeโ controls whether the CPU usage is shown as percentage or time. By default, the CPU usage is shown as percentage. When the option is used without an argument, it is equivalent to--cpu=time. This setting may also be toggled at runtime by pressing the % key.
Added in version 226.
-Pโ count only userspace processes instead of all tasks. By default, all tasks are counted: each kernel thread and each userspace thread individually. With this setting, kernel threads are excluded from the count and each userspace process only counts as one task, regardless of how many threads it consists of. This setting may also be toggled at runtime by pressing the P key. This option may not be combined with-k.
Added in version 227.
-kโ count only userspace processes and kernel threads instead of all tasks. By default, all tasks are counted: each kernel thread and each userspace thread individually. With this setting, kernel threads are included in the count and each userspace process only counts as one task, regardless of how many threads it consists of. This setting may also be toggled at runtime by pressing the k key. This option may not be combined with-P.
Added in version 226.
--recursive=โ controls whether the number of processes shown for a control group shall include all processes that are contained in any of the child control groups as well. Takes a boolean argument, which defaults to"yes". If enabled, the processes in child control groups are included; if disabled, only the processes in the control group itself are counted. This setting may also be toggled at runtime by pressing the r key. Note that this setting only applies to process counting, i.e. when the-Por-koptions are used. When all tasks are counted, setting this option to"no"is rejected with an error, as task counting is always recursive. ๐ซ
Added in version 226.
-n,--iterations=โ perform only this many iterations. A value of0indicates that the program should run indefinitely.
Added in version 188.
-1โ a shortcut for--iterations=1.
Added in version 238.
-d,--delay=โ specify refresh delay in seconds (or if one of"ms","us","min"is specified as unit in this time unit). This setting may also be increased and decreased at runtime by pressing the + and - keys.--depth=โ maximum control group tree traversal depth. Specifies how deepsystemd-cgtopshall traverse the control group hierarchies. If0is specified, only the root group is monitored. For1, only the first level of control groups is monitored, and so on. Defaults to3.-M MACHINE,--machine=MACHINEโ limit control groups shown to the part corresponding to the container MACHINE. This option may not be used when a control group path is specified.
Added in version 227.
-h,--helpโ print a short help text and exit.--versionโ print a short version string and exit.
๐ KEYS ๐
systemd-cgtop is an interactive tool and may be controlled via user input using the following keys:
- h โ shows a short help text.
- Space โ immediately refresh output.
Added in version 226.
- q โ terminate the program.
- p, t, c, m, i โ sort the control groups by path, number of tasks, CPU load, memory usage, or I/O load, respectively. This setting may also be controlled using the
--order=command line switch. - % โ toggle between showing CPU time as time or percentage. This setting may also be controlled using the
--cpu=command line switch.
Added in version 201.
- +, - โ increase or decrease refresh delay, respectively. This setting may also be controlled using the
--delay=command line switch. - P โ toggle between counting all tasks, or only userspace processes. This setting may also be controlled using the
-Pcommand line switch (see above).
Added in version 227.
- k โ toggle between counting all tasks, or only userspace processes and kernel threads. This setting may also be controlled using the
-kcommand line switch (see above).
Added in version 226.
- r โ toggle between recursively including or excluding processes in child control groups in control group process counts. This setting may also be controlled using the
--recursive=command line switch. This key is not available if all tasks are counted; it is only available if processes are counted, as enabled with the P or k keys.
Added in version 226.
๐ EXIT STATUS ๐
On success, 0 is returned, a non-zero failure code otherwise. simple as that ๐
๐ SEE ALSO ๐
systemd(1), systemctl(1), systemd-cgls(1), systemd.resource-control(5), top(1)
okay that's the whole page, bestie ๐ซถ this one's straight from systemd 262.1 โ go forth and watch your cgroups eat CPU, mwah ๐ โจ
๐ฆ where this page comes from
- arch rolling: systemd 262.1-1 ยท LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms