xref: /freebsd/usr.bin/vmstat/vmstat.8 (revision 601752d5a7bef087e755da5a2b158fa35cb51ccb)
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.12 1999/02/13 09:59:24 dillon 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 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.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 2.
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.It Fl z
194Report on memory used by the kernel zone allocator, by zone.
195.El
196.It memory
197Information about the usage of virtual and real memory.
198Virtual pages (reported in units of 1024 bytes) are considered active if
199they belong to processes which are running or have run in the last 20
200seconds.
201.Pp
202.Bl -tag -width indent -compact
203.It avm
204active virtual pages
205.It fre
206size of the free list
207.El
208.It page
209Information about page faults and paging activity.
210These are averaged each five seconds, and given in units per second.
211.Pp
212.Bl -tag -width indent -compact
213.It flt
214total number of page faults
215.It re
216page reclaims (simulating reference bits)
217.\" .It at
218.\" pages attached (found in free list)
219.It pi
220pages paged in
221.It po
222pages paged out
223.It fr
224pages freed per second
225.\" .It de
226.\" anticipated short term memory shortfall
227.It sr
228pages scanned by clock algorithm, per-second
229.El
230.It disks
231Disk operations per second (this field is system dependent).
232Typically paging will be split across the available drives.
233The header of the field is the first two characters of the disk name and
234the unit number.
235If more than three disk drives are configured in the system,
236.Nm
237displays only the first three drives, unless the user specifies the
238.Fl n
239argument to increase the number of drives displayed.  This will probably
240cause the display to exceed 80 columns, however.
241To force
242.Nm
243to display specific drives, their names may be supplied on the command line.
244.Nm
245defaults to show disks first, and then various other random devices in the
246system to add up to three devices, if there are that many devices in the
247system.  If devices are specified on the command line, or if a device type
248matching pattern is specified (see above),
249.Nm
250will only display the given devices or the devices matching the pattern,
251and will not randomly select other devices in the system.
252.It faults
253Trap/interrupt rate averages per second over last 5 seconds.
254.Pp
255.Bl -tag -width indent -compact
256.It in
257device interrupts per interval (including clock interrupts)
258.It sy
259system calls per interval
260.It cs
261cpu context switch rate (switches/interval)
262.El
263.It cpu
264Breakdown of percentage usage of CPU time.
265.Pp
266.Bl -tag -width indent -compact
267.It us
268user time for normal and low priority processes
269.It sy
270system time
271.It id
272cpu idle
273.El
274.El
275.Sh EXAMPLES
276The command:
277.Dl vmstat -w 5
278will print what the system is doing every five
279seconds; this is a good choice of printing interval since this is how often
280some of the statistics are sampled in the system.
281Others vary every second and running the output for a while will make it
282apparent which are recomputed every second.
283.Pp
284The command:
285.Dl vmstat -p da -p cd -w 1
286will tell vmstat to select the first three direct access or CDROM devices
287and display statistics on those devices, as well as other systems
288statistics every second.
289.Sh FILES
290.Bl -tag -width /dev/kmemxxx -compact
291.It Pa /kernel
292default kernel namelist
293.It Pa /dev/kmem
294default memory file
295.El
296.Sh SEE ALSO
297.Xr fstat 1 ,
298.Xr netstat 1 ,
299.Xr nfsstat 1 ,
300.Xr ps 1 ,
301.Xr systat 1 ,
302.Xr iostat 8 ,
303.Xr pstat 8
304.Pp
305The sections starting with ``Interpreting system activity'' in
306.%T "Installing and Operating 4.3BSD" .
307.Sh BUGS
308The
309.Fl c
310and
311.Fl w
312options are only available with the default output.
313