]>
Commit | Line | Data |
---|---|---|
d9dfd233 | 1 | <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*--> |
663996b3 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
e735f4d4 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
663996b3 MS |
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 | |
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 | |
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 | |
18 | Lesser General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU Lesser General Public License | |
21 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
22 | --> | |
23 | ||
60f067b4 | 24 | <refentry id="systemd-cgtop" |
e735f4d4 MP |
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 | |
86f210e9 MP |
65 | <citerefentry project='man-pages'><refentrytitle>top</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para> |
66 | ||
d9dfd233 MP |
67 | <para>If <command>systemd-cgtop</command> is not connected to a |
68 | tty, no column headers are printed and the default is to only run | |
69 | one iteration. The <varname>--iterations=</varname> argument, if | |
70 | given, is honored. This mode is suitable for scripting.</para> | |
e735f4d4 MP |
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 | ||
86f210e9 MP |
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 | ||
e735f4d4 MP |
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> | |
d9dfd233 | 107 | <term><option>--order=path</option></term> |
e735f4d4 MP |
108 | |
109 | <listitem><para>Order by control group | |
110 | path name.</para></listitem> | |
111 | </varlistentry> | |
112 | ||
113 | <varlistentry> | |
114 | <term><option>-t</option></term> | |
d9dfd233 | 115 | <term><option>--order=tasks</option></term> |
e735f4d4 | 116 | |
d9dfd233 | 117 | <listitem><para>Order by number of processes in control group.</para></listitem> |
e735f4d4 MP |
118 | </varlistentry> |
119 | ||
120 | <varlistentry> | |
121 | <term><option>-c</option></term> | |
d9dfd233 | 122 | <term><option>--order=cpu</option></term> |
e735f4d4 MP |
123 | |
124 | <listitem><para>Order by CPU load.</para></listitem> | |
125 | </varlistentry> | |
126 | ||
127 | <varlistentry> | |
128 | <term><option>-m</option></term> | |
d9dfd233 | 129 | <term><option>--order=memory</option></term> |
e735f4d4 MP |
130 | |
131 | <listitem><para>Order by memory usage.</para></listitem> | |
132 | </varlistentry> | |
133 | ||
134 | <varlistentry> | |
135 | <term><option>-i</option></term> | |
d9dfd233 | 136 | <term><option>--order=io</option></term> |
e735f4d4 MP |
137 | |
138 | <listitem><para>Order by disk I/O load.</para></listitem> | |
139 | </varlistentry> | |
140 | ||
141 | <varlistentry> | |
142 | <term><option>-b</option></term> | |
143 | <term><option>--batch</option></term> | |
144 | ||
145 | <listitem><para>Run in "batch" mode: do not accept input and | |
146 | run until the iteration limit set with | |
d9dfd233 | 147 | <option>--iterations=</option> is exhausted or until killed. |
e735f4d4 MP |
148 | This mode could be useful for sending output from |
149 | <command>systemd-cgtop</command> to other programs or to a | |
150 | file.</para></listitem> | |
151 | </varlistentry> | |
152 | ||
86f210e9 MP |
153 | <varlistentry> |
154 | <term><option>-r</option></term> | |
155 | <term><option>--raw</option></term> | |
156 | ||
157 | <listitem><para>Format byte counts (as in memory usage and IO metrics) | |
158 | with raw numeric values rather than human-readable | |
159 | numbers.</para></listitem> | |
160 | </varlistentry> | |
161 | ||
d9dfd233 MP |
162 | <varlistentry> |
163 | <term><option>--cpu=percentage</option></term> | |
164 | <term><option>--cpu=time</option></term> | |
165 | ||
166 | <listitem><para>Controls whether the CPU usage is shown as | |
167 | percentage or time. By default the CPU usage is shown as | |
168 | percentage. This setting may also be toggled at runtime by | |
169 | pressing the <keycap>%</keycap> key.</para></listitem> | |
170 | </varlistentry> | |
171 | ||
172 | <varlistentry> | |
173 | <term><option>-k</option></term> | |
174 | ||
175 | <listitem><para>Include kernel threads when counting tasks in | |
176 | control groups. By default, kernel threads are not included in | |
177 | the count. This setting may also be toggled at runtime by | |
178 | pressing the <keycap>k</keycap> key.</para></listitem> | |
179 | </varlistentry> | |
180 | ||
181 | <varlistentry> | |
182 | <term><option>--recursive=</option></term> | |
183 | ||
184 | <listitem><para>Controls whether the number of tasks shown for | |
185 | a control group shall include all tasks that are contained in | |
186 | any of the child control groups as well. Takes a boolean | |
187 | argument, defaults to <literal>yes</literal>. If enabled the | |
188 | tasks in child control groups are included, if disabled only | |
189 | the tasks in the control group itself are counted. This | |
190 | setting may also be toggled at runtime by pressing the | |
191 | <keycap>r</keycap> key.</para></listitem> | |
192 | </varlistentry> | |
193 | ||
e735f4d4 MP |
194 | <varlistentry> |
195 | <term><option>-n</option></term> | |
196 | <term><option>--iterations=</option></term> | |
197 | ||
d9dfd233 MP |
198 | <listitem><para>Perform only this many iterations. A value of |
199 | 0 indicates that the program should run | |
200 | indefinitely.</para></listitem> | |
e735f4d4 MP |
201 | </varlistentry> |
202 | ||
203 | <varlistentry> | |
204 | <term><option>-d</option></term> | |
205 | <term><option>--delay=</option></term> | |
206 | ||
207 | <listitem><para>Specify refresh delay in seconds (or if one of | |
d9dfd233 | 208 | <literal>ms</literal>, <literal>us</literal>, |
e735f4d4 | 209 | <literal>min</literal> is specified as unit in this time |
d9dfd233 MP |
210 | unit). This setting may also be increased and decreased at |
211 | runtime by pressing the <keycap>+</keycap> and | |
212 | <keycap>-</keycap> keys.</para></listitem> | |
e735f4d4 MP |
213 | </varlistentry> |
214 | ||
215 | <varlistentry> | |
216 | <term><option>--depth=</option></term> | |
217 | ||
218 | <listitem><para>Maximum control group tree traversal depth. | |
219 | Specifies how deep <command>systemd-cgtop</command> shall | |
220 | traverse the control group hierarchies. If 0 is specified, | |
221 | only the root group is monitored. For 1, only the first level | |
222 | of control groups is monitored, and so on. Defaults to | |
223 | 3.</para></listitem> | |
224 | </varlistentry> | |
225 | ||
226 | <xi:include href="standard-options.xml" xpointer="help" /> | |
227 | <xi:include href="standard-options.xml" xpointer="version" /> | |
228 | </variablelist> | |
229 | ||
230 | </refsect1> | |
231 | ||
e735f4d4 MP |
232 | <refsect1> |
233 | <title>Keys</title> | |
234 | ||
235 | <para><command>systemd-cgtop</command> is an interactive tool and | |
236 | may be controlled via user input using the following keys:</para> | |
237 | ||
238 | <variablelist> | |
239 | <varlistentry> | |
d9dfd233 | 240 | <term><keycap>h</keycap></term> |
e735f4d4 MP |
241 | |
242 | <listitem><para>Shows a short help text.</para></listitem> | |
243 | </varlistentry> | |
244 | ||
245 | <varlistentry> | |
d9dfd233 | 246 | <term><keycap function="space"/></term> |
e735f4d4 MP |
247 | |
248 | <listitem><para>Immediately refresh output.</para></listitem> | |
249 | </varlistentry> | |
250 | ||
251 | <varlistentry> | |
d9dfd233 | 252 | <term><keycap>q</keycap></term> |
e735f4d4 MP |
253 | |
254 | <listitem><para>Terminate the program.</para></listitem> | |
255 | </varlistentry> | |
256 | ||
e735f4d4 | 257 | <varlistentry> |
d9dfd233 MP |
258 | <term><keycap>p</keycap></term> |
259 | <term><keycap>t</keycap></term> | |
260 | <term><keycap>c</keycap></term> | |
261 | <term><keycap>m</keycap></term> | |
262 | <term><keycap>i</keycap></term> | |
e735f4d4 MP |
263 | |
264 | <listitem><para>Sort the control groups by path, number of | |
d9dfd233 MP |
265 | tasks, CPU load, memory usage, or IO load, respectively. This |
266 | setting may also be controlled using the | |
267 | <option>--order=</option> command line | |
268 | switch.</para></listitem> | |
e735f4d4 MP |
269 | </varlistentry> |
270 | ||
271 | <varlistentry> | |
d9dfd233 | 272 | <term><keycap>%</keycap></term> |
e735f4d4 MP |
273 | |
274 | <listitem><para>Toggle between showing CPU time as time or | |
d9dfd233 MP |
275 | percentage. This setting may also be controlled using the |
276 | <option>--cpu=</option> command line switch.</para></listitem> | |
e735f4d4 MP |
277 | </varlistentry> |
278 | ||
279 | <varlistentry> | |
d9dfd233 MP |
280 | <term><keycap>+</keycap></term> |
281 | <term><keycap>-</keycap></term> | |
e735f4d4 MP |
282 | |
283 | <listitem><para>Increase or decrease refresh delay, | |
d9dfd233 MP |
284 | respectively. This setting may also be controlled using the |
285 | <option>--delay=</option> command line | |
286 | switch.</para></listitem> | |
287 | </varlistentry> | |
288 | ||
289 | <varlistentry> | |
290 | <term><keycap>k</keycap></term> | |
291 | ||
292 | <listitem><para>Toggle between including or excluding kernel | |
293 | threads in control group task counts. This setting may also be | |
294 | controlled using the <option>-k</option> command line | |
295 | switch.</para></listitem> | |
296 | </varlistentry> | |
297 | ||
298 | <varlistentry> | |
299 | <term><keycap>r</keycap></term> | |
300 | ||
301 | <listitem><para>Toggle between recursively including or | |
302 | excluding tasks in child control groups in control group task | |
303 | counts. This setting may also be controlled using the | |
304 | <option>--recursive=</option> command line | |
305 | switch.</para></listitem> | |
e735f4d4 MP |
306 | </varlistentry> |
307 | ||
308 | </variablelist> | |
309 | </refsect1> | |
310 | ||
311 | <refsect1> | |
312 | <title>Exit status</title> | |
313 | ||
314 | <para>On success, 0 is returned, a non-zero failure code | |
315 | otherwise.</para> | |
316 | </refsect1> | |
317 | ||
318 | <refsect1> | |
319 | <title>See Also</title> | |
320 | <para> | |
321 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
322 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
323 | <citerefentry><refentrytitle>systemd-cgls</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
324 | <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
325 | <citerefentry project='man-pages'><refentrytitle>top</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
326 | </para> | |
327 | </refsect1> | |
663996b3 MS |
328 | |
329 | </refentry> |