Record memory statistics information to 'rd' object.
[virt-top.git] / virt-top / virt-top.txt
1 NAME
2     virt-top - 'top'-like utility for virtualization stats
3
4 SUMMARY
5     virt-top [-options]
6
7 DESCRIPTION
8     virt-top is a top(1)-like utility for showing stats of virtualized
9     domains. Many keys and command line options are the same as for ordinary
10     *top*.
11
12     It uses libvirt so it is capable of showing stats across a variety of
13     different virtualization systems.
14
15 OPTIONS
16     -1  Display physical CPUs by default (instead of domains). When virt-top
17         is running, use the *1* key to toggle between physical CPUs and
18         domains display.
19
20     -2  Display network interfaces by default (instead of domains). When
21         virt-top is running, use the *2* key to toggle between network
22         interfaces and domains display.
23
24     -3  Display block devices (virtual disks) by default (instead of
25         domains). When virt-top is running, use the *3* key to toggle
26         between block devices and domains display.
27
28     -b  Batch mode. In this mode keypresses are ignored.
29
30     -c uri or --connect uri
31         Connect to URI given. The default is to connect to the Xen
32         hypervisor.
33
34         To connect to QEMU/KVM you would normally do *-c qemu:///system*
35
36         To connect to libvirtd on a remote machine you would normally do *-c
37         xen://host/*
38
39         Full details on connection URIs is available at
40         <http://libvirt.org/uri.html>
41
42     -d delay
43         Set the delay between screen updates in seconds. The default is 3.0
44         seconds. You can change this while virt-top is running by pressing
45         either *s* or *d* key.
46
47     -n iterations
48         Set the number of iterations to run. The default is to run
49         continuously.
50
51     -o sort
52         Set the sort order to one of: cpu (sort by %CPU used), mem (sort by
53         total memory), time (sort by total time), id (sort by domain ID),
54         name (sort by domain name), netrx (sort by network received bytes),
55         nettx (sort by network transmitted bytes), blockrdrq (sort by block
56         device [disk] read requests), blockwrrq (sort by block device [disk]
57         write requests).
58
59         While virt-top is running you can change the sort order using keys
60         *P* (cpu), *M* (memory), *T* (total time), *N* (domain ID), *F*
61         (interactively select the sort field).
62
63     -s  Secure mode. Currently this does nothing.
64
65     --hist-cpu secs
66         Set the time in seconds between updates of the historical %CPU at
67         the top right of the display.
68
69     --csv file.csv
70         Write the statistics to file *file.csv*. First a header is written
71         showing the statistics being recorded in each column, then one line
72         is written for each screen update. The CSV file can be loaded
73         directly by most spreadsheet programs.
74
75         Currently the statistics which this records vary between releases of
76         virt-top (but the column headers will stay the same, so you can use
77         those to process the CSV file).
78
79         Not every version of virt-top supports CSV output - it depends how
80         the program was compiled (see *README* file in the source
81         distribution for details).
82
83         To save space you can compress your CSV files (if your shell
84         supports this feature, eg. *bash*):
85
86          virt-top --csv >(gzip -9 > output.csv.gz)
87
88         You can use a similar trick to split the CSV file up. In this
89         example the CSV file is split every 1000 lines into files called
90         *output.csv.00*, *output.csv.01* etc.
91
92          virt-top --csv >(split -d -l 1000 - output.csv.)
93
94     --no-csv-cpu
95         Disable domain CPU stats in CSV output.
96
97     --no-csv-block
98         Disable domain block device stats in CSV output.
99
100     --no-csv-net
101         Disable domain network interface stats in CSV output.
102
103     --debug filename
104         Send debug and error messages to *filename*. To send error messages
105         to syslog you can do:
106
107          virt-top --debug >(logger -t virt-top)
108
109         See also REPORTING BUGS below.
110
111     --init-file filename
112         Read *filename* as the init file instead of the default which is
113         *$HOME/.virt-toprc*. See also INIT FILE below.
114
115     --no-init-file
116         Do not read any init file.
117
118     --script
119         Script mode. There will be no user interface. This is most useful
120         when used together with the *--csv* and *-n* options.
121
122     --stream
123         Stream mode. All output is sent to stdout. This can be used from
124         shell scripts etc. There is no user interface.
125
126     --block-in-bytes
127         Show I/O statistics in Bytes. Default is shown in the number of
128         Requests.
129
130     --end-time time
131         The program will exit at the *time* given.
132
133         The time may be given in one of the following formats:
134
135         *YYYY-MM-DD HH:MM:SS*
136             End time is the date and time given.
137
138         *HH:MM:SS*
139             End time is the time given, today.
140
141         *+HH:MM:SS*
142             End time is HH hours, MM minutes, SS seconds in the future
143             (counted from the moment that program starts).
144
145         *+secs*
146             End time is *secs* seconds in the future.
147
148         For example to run the program for 3 minutes you could do:
149
150          virt-top --end-time +00:03:00
151
152         or:
153
154          virt-top --end-time +180
155
156         Not every version of virt-top supports this option - it depends how
157         the program was compiled (see *README* file in the source
158         distribution for details).
159
160     --help
161         Display usage summary.
162
163     --version
164         Display version number and exit.
165
166 KEYS
167     Note that keys are case sensitive. For example use upper-case *P* (shift
168     P) to sort by %CPU. *^* before a key means a Ctrl key, so *^L* is Ctrl
169     L.
170
171     *space* or *^L*
172         Updates the display.
173
174     *q* Quits the program.
175
176     *h* Displays help.
177
178     *s* or *d*
179         Change the delay between screen updates.
180
181     *B* Toggle Block I/O statistics so they are shown in either bytes or
182         requests.
183
184     *0* (number 0)
185         Show the normal list of domains display.
186
187     *1* (number 1)
188         Toggle into showing physical CPUs. If pressed again toggles back to
189         showing domains (the normal display).
190
191     *2* Toggle into showing network interfaces. If pressed again toggles
192         back to showing domains.
193
194     *3* Toggle into showing block devices (virtual disks). If pressed again
195         toggles back to showing domains.
196
197     *P* Sort by %CPU.
198
199     *M* Sort by total memory. Note that this shows the total memory
200         allocated to the guest, not the memory being used.
201
202     *T* Sort by total time.
203
204     *N* Sort by domain ID.
205
206     *F* Select the sort field interactively (there are other sort fields you
207         can choose using this key).
208
209     *W* This creates or overwrites the init file with the current settings.
210
211         This key is disabled if *--no-init-file* was specified on the
212         command line or if *overwrite-init-file false* is given in the init
213         file.
214
215 INIT FILE
216     When virt-top starts up, it reads initial settings from the file
217     *.virt-toprc* in the user's home directory.
218
219     The name of this file may be overridden using the *--init-file filename*
220     command line option or may be disabled entirely using *--no-init-file*.
221
222     The init file has a simple format. Blank lines and comments beginning
223     with *#* are ignored. Everything else is a set of *key value* pairs,
224     described below.
225
226     display *task|pcpu|block|net*
227         Sets the major display mode to one of *task* (tasks, the default),
228         *pcpu* (physical CPUs), *block* (block devices), or *net* (network
229         interfaces).
230
231     delay *secs*
232         Sets the delay between display updates in seconds.
233
234     hist-cpu *secs*
235         Sets the historical CPU delay in seconds.
236
237     iterations *n*
238         Sets the number of iterations to run before we exit. Setting this to
239         *-1* means to run continuously.
240
241     sort *cpu|mem|time|id|name|...*
242         Sets the sort order. The option names are the same as for the
243         command line *-o* option.
244
245     connect *uri*
246         Sets the default connection URI.
247
248     debug *filename*
249         Sets the default filename to use for debug and error messages.
250
251     csv *filename*
252         Enables CSV output to the named file.
253
254     csv-cpu *true|false*
255         Enable or disable domain CPU stats in CSV output.
256
257     csv-block *true|false*
258         Enable or disable domain block device stats in CSV output.
259
260     csv-net *true|false*
261         Enable or disable domain network interface stats in CSV output.
262
263     batch *true|false*
264         Sets batch mode.
265
266     secure *true|false*
267         Sets secure mode.
268
269     script *true|false*
270         Sets script mode.
271
272     stream *true|false*
273         Sets stream mode.
274
275     block-in-bytes *true|false*
276         Show block device statistics in bytes.
277
278     end-time *time*
279         Set the time at which the program exits. See above for the time
280         formats supported.
281
282     overwrite-init-file *false*
283         If set to *false* then the *W* key will not overwrite the init file.
284
285     Note that in the current implementation, options specified in the init
286     file override options specified on the command line. This is a bug and
287     this behaviour may change in the future.
288
289 NOTES
290   Block I/O statistics
291     This I/O value is the amount of I/O since the previous iteration of
292     virt-top. To calculate speed of I/O, you should divide the number by
293     delay secs.
294
295   NETWORK RX BYTES AND PACKETS
296     Libvirt/virt-top has no way to know that a packet transmitted to a guest
297     was received (eg. if the guest is not listening). In the network RX
298     stats, virt-top reports the packets transmitted to the guest, on the
299     basis that the guest might receive them.
300
301     In particular this includes broadcast packets. Because of the way that
302     Linux bridges work, if the guest is connected to a bridge, it will
303     probably see a steady "background noise" of RX packets even when the
304     network interface is idle or down. These are caused by STP packets
305     generated by the bridge.
306
307 SEE ALSO
308     top(1), virsh(1), <http://www.libvirt.org/ocaml/>,
309     <http://www.libvirt.org/>, <http://people.redhat.com/~rjones/>,
310     <http://caml.inria.fr/>
311
312 AUTHORS
313     Richard W.M. Jones <rjones @ redhat . com>
314
315 COPYRIGHT
316     (C) Copyright 2007-2011 Red Hat Inc., Richard W.M. Jones
317     http://libvirt.org/
318
319     This program is free software; you can redistribute it and/or modify it
320     under the terms of the GNU General Public License as published by the
321     Free Software Foundation; either version 2 of the License, or (at your
322     option) any later version.
323
324     This program is distributed in the hope that it will be useful, but
325     WITHOUT ANY WARRANTY; without even the implied warranty of
326     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
327     Public License for more details.
328
329     You should have received a copy of the GNU General Public License along
330     with this program; if not, write to the Free Software Foundation, Inc.,
331     675 Mass Ave, Cambridge, MA 02139, USA.
332
333 REPORTING BUGS
334     Bugs can be viewed on the Red Hat Bugzilla page:
335     <https://bugzilla.redhat.com/>.
336
337     If you find a bug in virt-top, please follow these steps to report it:
338
339     1. Check for existing bug reports
340         Go to <https://bugzilla.redhat.com/> and search for similar bugs.
341         Someone may already have reported the same bug, and they may even
342         have fixed it.
343
344     2. Capture debug and error messages
345         Run
346
347          virt-top --debug virt-top.log
348
349         and keep *virt-top.log*. It contains error messages which you should
350         submit with your bug report.
351
352     3. Get version of virt-top and version of libvirt.
353         Use:
354
355          virt-top --version
356
357         If you can get the precise version of libvirt you are using then
358         that too is helpful.
359
360     4. Submit a bug report.
361         Go to <https://bugzilla.redhat.com/> and enter a new bug. Please
362         describe the problem in as much detail as possible.
363
364         Remember to include the version numbers (step 3) and the debug
365         messages file (step 2).
366
367     5. Assign the bug to rjones @ redhat.com
368         Assign or reassign the bug to rjones @ redhat.com (without the
369         spaces). You can also send me an email with the bug number if you
370         want a faster response.
371