]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-cgtop.xml
man: revert dynamic paths for split-usr setups
[thirdparty/systemd.git] / man / systemd-cgtop.xml
CommitLineData
caa94887
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
caa94887
LP
4
5<!--
6 This file is part of systemd.
7
8 Copyright 2012 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
caa94887
LP
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 18 Lesser General Public License for more details.
caa94887 19
5430f7f2 20 You should have received a copy of the GNU Lesser General Public License
caa94887
LP
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22-->
23
dfdebb1b 24<refentry id="systemd-cgtop"
798d3a52
ZJS
25 xmlns:xi="http://www.w3.org/2001/XInclude">
26
27 <refentryinfo>
28 <title>systemd-cgtop</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>systemd-cgtop</refentrytitle>
43 <manvolnum>1</manvolnum>
44 </refmeta>
45
46 <refnamediv>
47 <refname>systemd-cgtop</refname>
48 <refpurpose>Show top control groups by their resource usage</refpurpose>
49 </refnamediv>
50
51 <refsynopsisdiv>
52 <cmdsynopsis>
53 <command>systemd-cgtop</command>
54 <arg choice="opt" rep="repeat">OPTIONS</arg>
55 </cmdsynopsis>
56 </refsynopsisdiv>
57
58 <refsect1>
59 <title>Description</title>
60
61 <para><command>systemd-cgtop</command> shows the top control
62 groups of the local Linux control group hierarchy, ordered by
63 their CPU, memory, or disk I/O load. The display is refreshed in
64 regular intervals (by default every 1s), similar in style to
780fe62e
CD
65 <citerefentry project='man-pages'><refentrytitle>top</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
66
67 <para>If <command>systemd-cgtop</command> is not connected to a tty, no
68 column headers are printed and the default is to only run one iteration.
69 The <varname>--iterations</varname> argument, if given, is still honored.
70 This mode is suitable for scripting.</para>
798d3a52
ZJS
71
72 <para>Resource usage is only accounted for control groups in the
73 relevant hierarchy, i.e. CPU usage is only accounted for control
74 groups in the <literal>cpuacct</literal> hierarchy, memory usage
75 only for those in <literal>memory</literal> and disk I/O usage for
76 those in <literal>blkio</literal>. If resource monitoring for
77 these resources is required, it is recommended to add the
78 <varname>CPUAccounting=1</varname>,
79 <varname>MemoryAccounting=1</varname> and
80 <varname>BlockIOAccounting=1</varname> settings in the unit files
81 in question. See
82 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
83 for details.</para>
84
b0f5a510
UTL
85 <para>The CPU load value can be between 0 and 100 times the number of
86 processors the system has. For example, if the system has 8 processors,
87 the CPU load value is going to be between 0% and 800%. The number of
88 processors can be found in <literal>/proc/cpuinfo</literal>.</para>
89
798d3a52
ZJS
90 <para>To emphasize this: unless
91 <literal>CPUAccounting=1</literal>,
92 <literal>MemoryAccounting=1</literal> and
93 <literal>BlockIOAccounting=1</literal> are enabled for the
94 services in question, no resource accounting will be available for
95 system services and the data shown by
96 <command>systemd-cgtop</command> will be incomplete.</para>
97 </refsect1>
98
99 <refsect1>
100 <title>Options</title>
101
102 <para>The following options are understood:</para>
103
104 <variablelist>
105 <varlistentry>
106 <term><option>-p</option></term>
107
108 <listitem><para>Order by control group
109 path name.</para></listitem>
110 </varlistentry>
111
112 <varlistentry>
113 <term><option>-t</option></term>
114
115 <listitem><para>Order by number of tasks in control group
116 (i.e. threads and processes).</para></listitem>
117 </varlistentry>
118
119 <varlistentry>
120 <term><option>-c</option></term>
121
122 <listitem><para>Order by CPU load.</para></listitem>
123 </varlistentry>
124
125 <varlistentry>
126 <term><option>-m</option></term>
127
128 <listitem><para>Order by memory usage.</para></listitem>
129 </varlistentry>
130
131 <varlistentry>
132 <term><option>-i</option></term>
133
134 <listitem><para>Order by disk I/O load.</para></listitem>
135 </varlistentry>
136
137 <varlistentry>
138 <term><option>-b</option></term>
139 <term><option>--batch</option></term>
140
141 <listitem><para>Run in "batch" mode: do not accept input and
142 run until the iteration limit set with
143 <option>--iterations</option> is exhausted or until killed.
144 This mode could be useful for sending output from
145 <command>systemd-cgtop</command> to other programs or to a
146 file.</para></listitem>
147 </varlistentry>
148
a2c9f631
CD
149 <varlistentry>
150 <term><option>-r</option></term>
151 <term><option>--raw</option></term>
152
153 <listitem><para>Format byte counts (as in memory usage and IO metrics)
154 with raw numeric values rather than human-readable
155 numbers.</para></listitem>
156 </varlistentry>
157
798d3a52
ZJS
158 <varlistentry>
159 <term><option>-n</option></term>
160 <term><option>--iterations=</option></term>
161
780fe62e
CD
162 <listitem><para>Perform only this many iterations. A value of 0
163 indicates that the program should run indefinitely.</para></listitem>
798d3a52
ZJS
164 </varlistentry>
165
166 <varlistentry>
167 <term><option>-d</option></term>
168 <term><option>--delay=</option></term>
169
170 <listitem><para>Specify refresh delay in seconds (or if one of
171 <literal>ms</literal>,
172 <literal>us</literal>,
173 <literal>min</literal> is specified as unit in this time
174 unit).</para></listitem>
175 </varlistentry>
176
177 <varlistentry>
178 <term><option>--depth=</option></term>
179
180 <listitem><para>Maximum control group tree traversal depth.
181 Specifies how deep <command>systemd-cgtop</command> shall
182 traverse the control group hierarchies. If 0 is specified,
183 only the root group is monitored. For 1, only the first level
184 of control groups is monitored, and so on. Defaults to
185 3.</para></listitem>
186 </varlistentry>
187
188 <xi:include href="standard-options.xml" xpointer="help" />
189 <xi:include href="standard-options.xml" xpointer="version" />
190 </variablelist>
191
192 </refsect1>
193
194
195 <refsect1>
196 <title>Keys</title>
197
198 <para><command>systemd-cgtop</command> is an interactive tool and
199 may be controlled via user input using the following keys:</para>
200
201 <variablelist>
202 <varlistentry>
203 <term>h</term>
204
205 <listitem><para>Shows a short help text.</para></listitem>
206 </varlistentry>
207
208 <varlistentry>
209 <term>SPACE</term>
210
211 <listitem><para>Immediately refresh output.</para></listitem>
212 </varlistentry>
213
214 <varlistentry>
215 <term>q</term>
216
217 <listitem><para>Terminate the program.</para></listitem>
218 </varlistentry>
219
220
221 <varlistentry>
222 <term>p</term>
223 <term>t</term>
224 <term>c</term>
225 <term>m</term>
226 <term>i</term>
227
228 <listitem><para>Sort the control groups by path, number of
229 tasks, CPU load, memory usage, or IO load, respectively.
230 </para></listitem>
231 </varlistentry>
232
233 <varlistentry>
234 <term>%</term>
235
236 <listitem><para>Toggle between showing CPU time as time or
237 percentage.</para></listitem>
238 </varlistentry>
239
240 <varlistentry>
241 <term>+</term>
242 <term>-</term>
243
244 <listitem><para>Increase or decrease refresh delay,
245 respectively.</para></listitem>
246 </varlistentry>
247
248 </variablelist>
249 </refsect1>
250
251 <refsect1>
252 <title>Exit status</title>
253
254 <para>On success, 0 is returned, a non-zero failure code
255 otherwise.</para>
256 </refsect1>
257
258 <refsect1>
259 <title>See Also</title>
260 <para>
261 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
262 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
263 <citerefentry><refentrytitle>systemd-cgls</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
264 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
265 <citerefentry project='man-pages'><refentrytitle>top</refentrytitle><manvolnum>1</manvolnum></citerefentry>
266 </para>
267 </refsect1>
caa94887
LP
268
269</refentry>