]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-cgtop.xml
logind: cast close() call to (void)
[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
780fe62e
CD
68 <citerefentry project='man-pages'><refentrytitle>top</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
69
70 <para>If <command>systemd-cgtop</command> is not connected to a tty, no
71 column headers are printed and the default is to only run one iteration.
72 The <varname>--iterations</varname> argument, if given, is still honored.
73 This mode is suitable for scripting.</para>
798d3a52
ZJS
74
75 <para>Resource usage is only accounted for control groups in the
76 relevant hierarchy, i.e. CPU usage is only accounted for control
77 groups in the <literal>cpuacct</literal> hierarchy, memory usage
78 only for those in <literal>memory</literal> and disk I/O usage for
79 those in <literal>blkio</literal>. If resource monitoring for
80 these resources is required, it is recommended to add the
81 <varname>CPUAccounting=1</varname>,
82 <varname>MemoryAccounting=1</varname> and
83 <varname>BlockIOAccounting=1</varname> settings in the unit files
84 in question. See
85 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
86 for details.</para>
87
88 <para>To emphasize this: unless
89 <literal>CPUAccounting=1</literal>,
90 <literal>MemoryAccounting=1</literal> and
91 <literal>BlockIOAccounting=1</literal> are enabled for the
92 services in question, no resource accounting will be available for
93 system services and the data shown by
94 <command>systemd-cgtop</command> will be incomplete.</para>
95 </refsect1>
96
97 <refsect1>
98 <title>Options</title>
99
100 <para>The following options are understood:</para>
101
102 <variablelist>
103 <varlistentry>
104 <term><option>-p</option></term>
105
106 <listitem><para>Order by control group
107 path name.</para></listitem>
108 </varlistentry>
109
110 <varlistentry>
111 <term><option>-t</option></term>
112
113 <listitem><para>Order by number of tasks in control group
114 (i.e. threads and processes).</para></listitem>
115 </varlistentry>
116
117 <varlistentry>
118 <term><option>-c</option></term>
119
120 <listitem><para>Order by CPU load.</para></listitem>
121 </varlistentry>
122
123 <varlistentry>
124 <term><option>-m</option></term>
125
126 <listitem><para>Order by memory usage.</para></listitem>
127 </varlistentry>
128
129 <varlistentry>
130 <term><option>-i</option></term>
131
132 <listitem><para>Order by disk I/O load.</para></listitem>
133 </varlistentry>
134
135 <varlistentry>
136 <term><option>-b</option></term>
137 <term><option>--batch</option></term>
138
139 <listitem><para>Run in "batch" mode: do not accept input and
140 run until the iteration limit set with
141 <option>--iterations</option> is exhausted or until killed.
142 This mode could be useful for sending output from
143 <command>systemd-cgtop</command> to other programs or to a
144 file.</para></listitem>
145 </varlistentry>
146
a2c9f631
CD
147 <varlistentry>
148 <term><option>-r</option></term>
149 <term><option>--raw</option></term>
150
151 <listitem><para>Format byte counts (as in memory usage and IO metrics)
152 with raw numeric values rather than human-readable
153 numbers.</para></listitem>
154 </varlistentry>
155
798d3a52
ZJS
156 <varlistentry>
157 <term><option>-n</option></term>
158 <term><option>--iterations=</option></term>
159
780fe62e
CD
160 <listitem><para>Perform only this many iterations. A value of 0
161 indicates that the program should run indefinitely.</para></listitem>
798d3a52
ZJS
162 </varlistentry>
163
164 <varlistentry>
165 <term><option>-d</option></term>
166 <term><option>--delay=</option></term>
167
168 <listitem><para>Specify refresh delay in seconds (or if one of
169 <literal>ms</literal>,
170 <literal>us</literal>,
171 <literal>min</literal> is specified as unit in this time
172 unit).</para></listitem>
173 </varlistentry>
174
175 <varlistentry>
176 <term><option>--depth=</option></term>
177
178 <listitem><para>Maximum control group tree traversal depth.
179 Specifies how deep <command>systemd-cgtop</command> shall
180 traverse the control group hierarchies. If 0 is specified,
181 only the root group is monitored. For 1, only the first level
182 of control groups is monitored, and so on. Defaults to
183 3.</para></listitem>
184 </varlistentry>
185
186 <xi:include href="standard-options.xml" xpointer="help" />
187 <xi:include href="standard-options.xml" xpointer="version" />
188 </variablelist>
189
190 </refsect1>
191
192
193 <refsect1>
194 <title>Keys</title>
195
196 <para><command>systemd-cgtop</command> is an interactive tool and
197 may be controlled via user input using the following keys:</para>
198
199 <variablelist>
200 <varlistentry>
201 <term>h</term>
202
203 <listitem><para>Shows a short help text.</para></listitem>
204 </varlistentry>
205
206 <varlistentry>
207 <term>SPACE</term>
208
209 <listitem><para>Immediately refresh output.</para></listitem>
210 </varlistentry>
211
212 <varlistentry>
213 <term>q</term>
214
215 <listitem><para>Terminate the program.</para></listitem>
216 </varlistentry>
217
218
219 <varlistentry>
220 <term>p</term>
221 <term>t</term>
222 <term>c</term>
223 <term>m</term>
224 <term>i</term>
225
226 <listitem><para>Sort the control groups by path, number of
227 tasks, CPU load, memory usage, or IO load, respectively.
228 </para></listitem>
229 </varlistentry>
230
231 <varlistentry>
232 <term>%</term>
233
234 <listitem><para>Toggle between showing CPU time as time or
235 percentage.</para></listitem>
236 </varlistentry>
237
238 <varlistentry>
239 <term>+</term>
240 <term>-</term>
241
242 <listitem><para>Increase or decrease refresh delay,
243 respectively.</para></listitem>
244 </varlistentry>
245
246 </variablelist>
247 </refsect1>
248
249 <refsect1>
250 <title>Exit status</title>
251
252 <para>On success, 0 is returned, a non-zero failure code
253 otherwise.</para>
254 </refsect1>
255
256 <refsect1>
257 <title>See Also</title>
258 <para>
259 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
260 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
261 <citerefentry><refentrytitle>systemd-cgls</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
262 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
263 <citerefentry project='man-pages'><refentrytitle>top</refentrytitle><manvolnum>1</manvolnum></citerefentry>
264 </para>
265 </refsect1>
caa94887
LP
266
267</refentry>