]> CyberLeo.Net >> Repos - FreeBSD/releng/10.3.git/blob - usr.bin/vmstat/vmstat.8
- Copy stable/10@296371 to releng/10.3 in preparation for 10.3-RC1
[FreeBSD/releng/10.3.git] / usr.bin / vmstat / vmstat.8
1 .\" Copyright (c) 1986, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)vmstat.8    8.1 (Berkeley) 6/6/93
29 .\" $FreeBSD$
30 .\"
31 .Dd August 8, 2014
32 .Dt VMSTAT 8
33 .Os
34 .Sh NAME
35 .Nm vmstat
36 .Nd report virtual memory statistics
37 .Sh SYNOPSIS
38 .Nm
39 .\" .Op Fl fimst
40 .Op Fl afHhimoPsz
41 .Op Fl M Ar core Op Fl N Ar system
42 .Op Fl c Ar count
43 .Op Fl n Ar devs
44 .Oo
45 .Fl p
46 .Sm off
47 .Ar type , if , pass
48 .Sm on
49 .Oc
50 .Op Fl w Ar wait
51 .Op Ar disks ...
52 .Op wait Op count
53 .Sh DESCRIPTION
54 The
55 .Nm
56 utility reports certain kernel statistics kept about process, virtual memory,
57 disk, trap and cpu activity.
58 .Pp
59 If the
60 .Fl M
61 option is not specified, information is obtained from
62 the currently running kernel via the
63 .Xr sysctl 3
64 interface.
65 Otherwise, information is read from the specified core file,
66 using the name list from the specified kernel image (or from
67 the default image).
68 .Pp
69 The options are as follows:
70 .Bl -tag -width indent
71 .It Fl a
72 When used with
73 .Fl i ,
74 include statistics about interrupts that have never been generated.
75 .It Fl c
76 Repeat the display
77 .Ar count
78 times.
79 The first display is for the time since a reboot and each subsequent
80 report is for the time period since the last display.
81 If no repeat
82 .Ar count
83 is specified, and
84 .Fl w
85 is specified, the default is infinity, otherwise the default is one.
86 .It Fl f
87 Report on the number
88 .Xr fork 2 ,
89 .Xr vfork 2
90 and
91 .Xr rfork 2
92 system calls since system startup, and the number of pages of virtual memory
93 involved in each.
94 .It Fl h
95 Changes memory columns into more easily human readable form.
96 The default if
97 standard output is a terminal device.
98 .It Fl H
99 Changes memory columns into straight numbers.
100 The default if standard output
101 is not a terminal device (such as a script).
102 .It Fl i
103 Report on the number of interrupts taken by each device since system
104 startup.
105 .It Fl M
106 Extract values associated with the name list from the specified
107 .Ar core .
108 .It Fl N
109 If
110 .Fl M
111 is also specified,
112 extract the name list from the specified
113 .Ar system
114 instead of the default,
115 which is the kernel image the system has booted from.
116 .It Fl m
117 Report on the usage of kernel dynamic memory allocated using
118 .Xr malloc 9
119 by type.
120 .It Fl n
121 Change the maximum number of disks to display from the default of 2.
122 .It Fl o
123 Display a list of virtual memory objects in the system and the resident
124 memory used by each object.
125 .It Fl P
126 Report per-cpu system/user/idle cpu statistics.
127 .It Fl p
128 Specify which types of devices to display.
129 There are three different
130 categories of devices:
131 .Pp
132 .Bl -tag -width indent -compact
133 .It device type:
134 .Bl -tag -width 9n -compact
135 .It da
136 Direct Access devices
137 .It sa
138 Sequential Access devices
139 .It printer
140 Printers
141 .It proc
142 Processor devices
143 .It worm
144 Write Once Read Multiple devices
145 .It cd
146 CD devices
147 .It scanner
148 Scanner devices
149 .It optical
150 Optical Memory devices
151 .It changer
152 Medium Changer devices
153 .It comm
154 Communication devices
155 .It array
156 Storage Array devices
157 .It enclosure
158 Enclosure Services devices
159 .It floppy
160 Floppy devices
161 .El
162 .Pp
163 .It interface:
164 .Bl -tag -width 9n -compact
165 .It IDE
166 Integrated Drive Electronics devices
167 .It SCSI
168 Small Computer System Interface devices
169 .It other
170 Any other device interface
171 .El
172 .Pp
173 .It passthrough:
174 .Bl -tag -width 9n -compact
175 .It pass
176 Passthrough devices
177 .El
178 .El
179 .Pp
180 The user must specify at least one device type, and may specify at most
181 one device type from each category.
182 Multiple device types in a single
183 device type statement must be separated by commas.
184 .Pp
185 Any number of
186 .Fl p
187 arguments may be specified on the command line.
188 All
189 .Fl p
190 arguments are ORed together to form a matching expression against which
191 all devices in the system are compared.
192 Any device that fully matches
193 any
194 .Fl p
195 argument will be included in the
196 .Nm
197 output, up to two devices, or the maximum number of devices specified
198 by the user.
199 .It Fl s
200 Display the contents of the
201 .Em sum
202 structure, giving the total number of several kinds of paging related
203 events which have occurred since system startup.
204 .\" .It Fl t
205 .\" Report on the number of page in and page reclaims since system startup,
206 .\" and the amount of time required by each.
207 .It Fl w
208 Pause
209 .Ar wait
210 seconds between each display.
211 If no repeat
212 .Ar wait
213 interval is specified, the default is 1 second.
214 The
215 .Nm
216 command will accept and honor a non-integer number of seconds.
217 .It Fl z
218 Report on memory used by the kernel zone allocator,
219 .Xr uma 9 ,
220 by zone.
221 .El
222 .Pp
223 The
224 .Ar wait
225 and
226 .Ar count
227 arguments may be given after their respective flags at any point
228 on the command line before the
229 .Ar disks
230 argument(s), or without their flags, as the final argument(s).
231 The latter form is accepted for backwards compatibility, but it is
232 preferred to use the forms with
233 .Fl w
234 and
235 .Fl c
236 to avoid ambiguity.
237 .Pp
238 By default,
239 .Nm
240 displays the following information:
241 .Bl -tag -width indent
242 .It procs
243 Information about the numbers of processes in various states.
244 .Pp
245 .Bl -tag -width indent -compact
246 .It r
247 in run queue
248 .It b
249 blocked for resources (i/o, paging, etc.)
250 .It w
251 runnable or short sleeper (< 20 secs) but swapped
252 .El
253 .It memory
254 Information about the usage of virtual and real memory.
255 Virtual pages (reported in units of 1024 bytes) are considered active if
256 they belong to processes which are running or have run in the last 20
257 seconds.
258 .Pp
259 .Bl -tag -width indent -compact
260 .It avm
261 active virtual pages
262 .It fre
263 size of the free list
264 .El
265 .It page
266 Information about page faults and paging activity.
267 These are averaged each five seconds, and given in units per second.
268 .Pp
269 .Bl -tag -width indent -compact
270 .It flt
271 total number of page faults
272 .It re
273 page reclaims (simulating reference bits)
274 .\" .It at
275 .\" pages attached (found in free list)
276 .It pi
277 pages paged in
278 .It po
279 pages paged out
280 .It fr
281 pages freed per second
282 .\" .It de
283 .\" anticipated short term memory shortfall
284 .It sr
285 pages scanned by clock algorithm, per-second
286 .El
287 .It disks
288 Disk operations per second (this field is system dependent).
289 Typically paging will be split across the available drives.
290 The header of the field is the first two characters of the disk name and
291 the unit number.
292 If more than two disk drives are configured in the system,
293 .Nm
294 displays only the first two drives, unless the user specifies the
295 .Fl n
296 argument to increase the number of drives displayed.
297 This will probably
298 cause the display to exceed 80 columns, however.
299 To force
300 .Nm
301 to display specific drives, their names may be supplied on the command line.
302 The
303 .Nm
304 utility
305 defaults to show disks first, and then various other random devices in the
306 system to add up to two devices, if there are that many devices in the
307 system.
308 If devices are specified on the command line, or if a device type
309 matching pattern is specified (see above),
310 .Nm
311 will only display the given devices or the devices matching the pattern,
312 and will not randomly select other devices in the system.
313 .It faults
314 Trap/interrupt rate averages per second over last 5 seconds.
315 .Pp
316 .Bl -tag -width indent -compact
317 .It in
318 device interrupts per interval (including clock interrupts)
319 .It sy
320 system calls per interval
321 .It cs
322 cpu context switch rate (switches/interval)
323 .El
324 .It cpu
325 Breakdown of percentage usage of CPU time.
326 .Pp
327 .Bl -tag -width indent -compact
328 .It us
329 user time for normal and low priority processes
330 .It sy
331 system time
332 .It id
333 cpu idle
334 .El
335 .El
336 .Sh FILES
337 .Bl -tag -width /boot/kernel/kernel -compact
338 .It Pa /boot/kernel/kernel
339 default kernel namelist
340 .It Pa /dev/kmem
341 default memory file
342 .El
343 .Sh EXAMPLES
344 The command:
345 .Dl vmstat -w 5
346 will print what the system is doing every five
347 seconds; this is a good choice of printing interval since this is how often
348 some of the statistics are sampled in the system.
349 Others vary every second and running the output for a while will make it
350 apparent which are recomputed every second.
351 .Pp
352 The command:
353 .Dl vmstat -p da -p cd -w 1
354 will tell vmstat to select the first two direct access or CDROM devices
355 and display statistics on those devices, as well as other systems
356 statistics every second.
357 .Sh SEE ALSO
358 .Xr fstat 1 ,
359 .Xr netstat 1 ,
360 .Xr nfsstat 1 ,
361 .Xr ps 1 ,
362 .Xr systat 1 ,
363 .Xr libmemstat 3 ,
364 .Xr gstat 8 ,
365 .Xr iostat 8 ,
366 .Xr pstat 8 ,
367 .Xr sysctl 8 ,
368 .Xr malloc 9 ,
369 .Xr uma 9
370 .Pp
371 The sections starting with ``Interpreting system activity'' in
372 .%T "Installing and Operating 4.3BSD" .
373 .Sh BUGS
374 The
375 .Fl c
376 and
377 .Fl w
378 options are only available with the default output.