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