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