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