]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - usr.bin/vmstat/vmstat.8
MFC 328134: Update various statements in vmstat(8) to match reality.
[FreeBSD/stable/10.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 January 18, 2018
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 number of threads in various states:
244 .Pp
245 .Bl -tag -width indent -compact
246 .It r
247 running or in run queue
248 .It b
249 blocked for resources (i/o, paging, etc.)
250 .It w
251 swapped out
252 .El
253 .It memory
254 Information about the usage of virtual and real memory.
255 .Pp
256 Mapped virtual memory is a sum of all of the virtual pages belonging
257 to mapped virtual memory objects.
258 Note that the entire memory object's size is considered mapped even if
259 only a subset of the object's pages are currently mapped.
260 This statistic is not related to the active page queue which is used to track
261 real memory.
262 .Pp
263 .Bl -tag -width indent -compact
264 .It avm
265 mapped virtual memory
266 .Po previously called active in
267 .Nm
268 output
269 .Pc
270 .It fre
271 size of the free list
272 .El
273 .It page
274 Information about page faults and paging activity.
275 These are given in units per second.
276 .Pp
277 .Bl -tag -width indent -compact
278 .It flt
279 total number of page faults
280 .It re
281 page reclaims (simulating reference bits)
282 .\" .It at
283 .\" pages attached (found in free list)
284 .It pi
285 pages paged in
286 .It po
287 pages paged out
288 .It fr
289 pages freed
290 .\" .It de
291 .\" anticipated short term memory shortfall
292 .It sr
293 pages scanned by page daemon
294 .El
295 .It disks
296 Disk operations per second (this field is system dependent).
297 Typically paging will be split across the available drives.
298 The header of the field is the first two characters of the disk name and
299 the unit number.
300 If more than two disk drives are configured in the system,
301 .Nm
302 displays only the first two drives, unless the user specifies the
303 .Fl n
304 argument to increase the number of drives displayed.
305 This will probably
306 cause the display to exceed 80 columns, however.
307 To force
308 .Nm
309 to display specific drives, their names may be supplied on the command line.
310 The
311 .Nm
312 utility
313 defaults to show disks first, and then various other random devices in the
314 system to add up to two devices, if there are that many devices in the
315 system.
316 If devices are specified on the command line, or if a device type
317 matching pattern is specified (see above),
318 .Nm
319 will only display the given devices or the devices matching the pattern,
320 and will not randomly select other devices in the system.
321 .It faults
322 Trap/interrupt rates per second.
323 .Pp
324 .Bl -tag -width indent -compact
325 .It in
326 device interrupts (including clock interrupts)
327 .It sy
328 system calls
329 .It cs
330 cpu context switches
331 .El
332 .It cpu
333 Breakdown of percentage usage of CPU time.
334 .Pp
335 .Bl -tag -width indent -compact
336 .It us
337 user time for normal and low priority processes
338 .It sy
339 system and interrupt time
340 .It id
341 cpu idle
342 .El
343 .El
344 .Sh FILES
345 .Bl -tag -width /boot/kernel/kernel -compact
346 .It Pa /boot/kernel/kernel
347 default kernel namelist
348 .It Pa /dev/kmem
349 default memory file
350 .El
351 .Sh EXAMPLES
352 The command:
353 .Dl vmstat -w 5
354 will print what the system is doing every five
355 seconds.
356 .Pp
357 The command:
358 .Dl vmstat -p da -p cd -w 1
359 will tell vmstat to select the first two direct access or CDROM devices
360 and display statistics on those devices, as well as other systems
361 statistics every second.
362 .Sh SEE ALSO
363 .Xr fstat 1 ,
364 .Xr netstat 1 ,
365 .Xr nfsstat 1 ,
366 .Xr ps 1 ,
367 .Xr systat 1 ,
368 .Xr libmemstat 3 ,
369 .Xr gstat 8 ,
370 .Xr iostat 8 ,
371 .Xr pstat 8 ,
372 .Xr sysctl 8 ,
373 .Xr malloc 9 ,
374 .Xr uma 9
375 .Pp
376 The sections starting with ``Interpreting system activity'' in
377 .%T "Installing and Operating 4.3BSD" .
378 .Sh BUGS
379 The
380 .Fl c
381 and
382 .Fl w
383 options are only available with the default output.