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