1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd-cgtop</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" title="systemd-cgtop"><a name="systemd-cgtop"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-cgtop — Show top control groups by their resource usage</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">systemd-cgtop [OPTIONS...]</code> </p></div></div><div class="refsect1" title="Description"><a name="id307675"></a><h2>Description</h2><p><span class="command"><strong>systemd-cgtop</strong></span> shows the top
2
control groups of the local Linux control group
3
hierarchy, ordered by their CPU, memory and disk I/O load. The
4
display is refreshed in regular intervals (by default
5
every 1s), similar in style to
6
<span class="citerefentry"><span class="refentrytitle">top</span>(1)</span>.</p><p>Resource usage is only accounted for control
7
groups in the relevant hierarchy, i.e. CPU usage is
8
only accounted for control groups in the
9
<code class="literal">cpuacct</code> hierarchy, memory usage
10
only for those in <code class="literal">memory</code> and disk
11
I/O usage for those in
12
<code class="literal">blkio</code>. <span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span>
13
by default places all services in their own control
14
group in the <code class="literal">cpuacct</code> hierarchy, but
15
not in <code class="literal">memory</code> nor
16
<code class="literal">blkio</code>. If resource monitoring for
17
these resources is required it is recommended to add
18
<code class="literal">blkio</code> and <code class="literal">memory</code>
19
to the <code class="varname">DefaultControllers=</code> setting
20
in <code class="filename">/etc/systemd/system.conf</code> (see
21
<span class="citerefentry"><span class="refentrytitle">systemd.conf</span>(5)</span>
22
for details). Alternatively, it is possible to enable
23
resource accounting individually for services, by
24
making use of the <code class="varname">ControlGroup=</code>
25
option in the unit files (See
26
<span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span>
27
for details).</p><p>To emphasize this: unless
28
<code class="literal">blkio</code> and <code class="literal">memory</code>
29
are enabled for the services in question with either
30
of the options suggested above no resource accounting
31
will be available for system services and the data shown
32
by <span class="command"><strong>systemd-cgtop</strong></span> will be
33
incomplete.</p></div><div class="refsect1" title="Options"><a name="id339939"></a><h2>Options</h2><p>The following options are understood:</p><div class="variablelist"><dl><dt><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span></dt><dd><p>Prints a short help
34
text and exits.</p></dd><dt><span class="term"><code class="option">-p</code></span></dt><dd><p>Order by control group
35
path name.</p></dd><dt><span class="term"><code class="option">-t</code></span></dt><dd><p>Order by number of
37
group (i.e. threads and processes).</p></dd><dt><span class="term"><code class="option">-c</code></span></dt><dd><p>Order by CPU load.</p></dd><dt><span class="term"><code class="option">-m</code></span></dt><dd><p>Order by memory usage.</p></dd><dt><span class="term"><code class="option">-i</code></span></dt><dd><p>Order by disk I/O load.</p></dd><dt><span class="term"><code class="option">-d</code>, </span><span class="term"><code class="option">--delay=</code></span></dt><dd><p>Specify refresh delay
38
in seconds (or if one of
39
<code class="literal">ms</code>,
40
<code class="literal">us</code>,
41
<code class="literal">min</code> is specified as
43
unit).</p></dd><dt><span class="term"><code class="option">--depth=</code></span></dt><dd><p>Maximum control group
44
tree traversal depth. Specifies how
45
deep <span class="command"><strong>systemd-cgtop</strong></span>
46
shall traverse the control group
47
hierarchies. If 0 is specified only
48
the root group is monitored, for 1
49
only the first level of control groups
50
is monitored, and so on. Defaults to
51
2.</p></dd></dl></div></div><div class="refsect1" title="Keys"><a name="id307488"></a><h2>Keys</h2><p><span class="command"><strong>systemd-cgtop</strong></span> is an
52
interactive tool and may be controlled via user input
53
using the following keys:</p><div class="variablelist"><dl><dt><span class="term">h</span></dt><dd><p>Shows a short help text.</p></dd><dt><span class="term">SPACE</span></dt><dd><p>Immediately refresh output.</p></dd><dt><span class="term">q</span></dt><dd><p>Terminate the program.</p></dd><dt><span class="term">p, </span><span class="term">t, </span><span class="term">c, </span><span class="term">m, </span><span class="term">i</span></dt><dd><p>Change ordering of control groups
54
by path, number of tasks, CPU load,
56
load.</p></dd><dt><span class="term">+, </span><span class="term">-</span></dt><dd><p>Increase,
57
resp. decrease refresh
58
delay.</p></dd></dl></div></div><div class="refsect1" title="Exit status"><a name="id307583"></a><h2>Exit status</h2><p>On success 0 is returned, a non-zero failure
59
code otherwise.</p></div><div class="refsect1" title="See Also"><a name="id307592"></a><h2>See Also</h2><p>
60
<span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span>,
61
<span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span>,
62
<span class="citerefentry"><span class="refentrytitle">systemd-cgls</span>(1)</span>,
63
<span class="citerefentry"><span class="refentrytitle">top</span>(1)</span>
64
</p></div></div></body></html>