xref: /netbsd-src/usr.bin/vmstat/vmstat.1 (revision ce666bb8ce77792a3948ca697c2fdad578a542a7)
1.\"	$NetBSD: vmstat.1,v 1.16 2005/03/10 16:29:04 wiz Exp $
2.\"
3.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the NetBSD
17.\"	Foundation, Inc. and its contributors.
18.\" 4. Neither the name of The NetBSD Foundation nor the names of its
19.\"    contributors may be used to endorse or promote products derived
20.\"    from this software without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
23.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
26.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32.\" POSSIBILITY OF SUCH DAMAGE.
33.\"
34.\" Copyright (c) 1986, 1993
35.\"	The Regents of the University of California.  All rights reserved.
36.\"
37.\" Redistribution and use in source and binary forms, with or without
38.\" modification, are permitted provided that the following conditions
39.\" are met:
40.\" 1. Redistributions of source code must retain the above copyright
41.\"    notice, this list of conditions and the following disclaimer.
42.\" 2. Redistributions in binary form must reproduce the above copyright
43.\"    notice, this list of conditions and the following disclaimer in the
44.\"    documentation and/or other materials provided with the distribution.
45.\" 3. Neither the name of the University nor the names of its contributors
46.\"    may be used to endorse or promote products derived from this software
47.\"    without specific prior written permission.
48.\"
49.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59.\" SUCH DAMAGE.
60.\"
61.\"	@(#)vmstat.8	8.1 (Berkeley) 6/6/93
62.\"
63.Dd March 10, 2005
64.Dt VMSTAT 1
65.Os
66.Sh NAME
67.Nm vmstat
68.Nd report virtual memory statistics
69.Sh SYNOPSIS
70.Nm
71.Op Fl efHiLlmstUvW
72.Op Fl c Ar count
73.Op Fl h Ar hashname
74.Op Fl M Ar core
75.Op Fl N Ar system
76.Op Fl u Ar histname
77.Op Fl w Ar wait
78.Op Ar disks
79.Sh DESCRIPTION
80.Nm
81reports certain kernel statistics kept about process, virtual memory,
82disk, trap, and CPU activity.
83.Pp
84The options are as follows:
85.Bl -tag -width xxxhistname
86.It Fl c Ar count
87Repeat the display
88.Ar count
89times.
90The first display is for the time since a reboot and each subsequent report
91is for the time period since the last display.
92If no
93.Ar wait
94interval is specified, the default is 1 second.
95.It Fl e
96Report the values of system event counters.
97.It Fl f
98Report fork statistics.
99.It Fl H
100Report all hash table statistics.
101.It Fl h Ar hashname
102Report hash table statistics for
103.Ar hashname .
104.It Fl i
105Report the values of system interrupt counters.
106.It Fl L
107List all the hashes supported for
108.Fl h
109and
110.Fl H .
111.It Fl l
112List the UVM histories being maintained by the kernel.
113.It Fl M Ar core
114Extract values associated with the name list from the specified core
115instead of the default
116.Pa /dev/mem .
117.It Fl m
118Report on the usage of kernel dynamic memory listed first by size of
119allocation and then by type of usage,
120followed by a list of the kernel memory pools and their usage.
121.It Fl N Ar system
122Extract the name list from the specified system instead of the default
123.Pa /netbsd .
124.It Fl s
125Display the contents of the
126.Dv uvmexp
127structure.
128This contains various paging event and memory status counters.
129.It Fl t
130Display the contents of the
131.Dv vmtotal
132structure.
133This includes information about processes and virtual memory.
134.Pp
135The process part shows the number of processes in the following states:
136.Pp
137.Bl -tag -width abc -compact
138.It ru
139on the run queue
140.It dw
141in disk I/O wait
142.It pw
143waiting for paging
144.It sl
145sleeping while resident
146.It sw
147swapped out, but either runnable or in short-term blocking state
148.El
149.Pp
150The virtual memory section shows:
151.Pp
152.Bl -tag -width abcdefgh -compact
153.It total-v
154Total virtual memory
155.It active-v
156Active virtual memory in use
157.It active-r
158Active real memory in use
159.It vm-sh
160Shared virtual memory
161.It avm-sh
162Active shared virtual memory
163.It rm-sh
164Shared real memory
165.It arm-sh
166Active shared real memory
167.It free
168Free memory
169.El
170.Pp
171All memory values are shown in number of pages.
172.It Fl U
173Dump all UVM histories.
174.It Fl u Ar histname
175Dump the specified UVM history.
176.It Fl v
177Print more verbose information.
178When used with the
179.Fl i ,
180.Fl e ,
181or
182.Fl m
183options prints out all counters, not just those with non-zero values.
184.It Fl W
185Print more verbose information about kernel memory pools.
186.It Fl w Ar wait
187Pause
188.Ar wait
189seconds between each display.
190If no repeat
191.Ar count
192is specified, the default is infinity.
193.El
194.Pp
195By default,
196.Nm
197displays the following information:
198.Pp
199.Bl -tag -width memory
200.It procs
201Information about the numbers of processes in various states.
202.Pp
203.Bl -tag -width abcd -compact
204.It r
205in run queue
206.It b
207blocked for resources (i/o, paging, etc.)
208.It w
209runnable or short sleeper (\*[Lt] 20 secs) but swapped
210.El
211.It memory
212Information about the usage of virtual and real memory.
213Virtual pages (reported in units of 1024 bytes) are considered active if
214they belong to processes which are running or have run in the last 20
215seconds.
216.Pp
217.Bl -tag -width abcd -compact
218.It avm
219active virtual pages
220.It fre
221size of the free list
222.El
223.It page
224Information about page faults and paging activity.
225These are averaged every five seconds, and given in units per second.
226.Pp
227.Bl -tag -width abcd -compact
228.It flt
229total page faults
230.It re
231page reclaims (simulating reference bits)
232.It pi
233pages paged in
234.It po
235pages paged out
236.It fr
237pages freed per second
238.It sr
239pages scanned by clock algorithm, per-second
240.El
241.It disks
242Disk transfers per second.
243Typically paging will be split across the available drives.
244The header of the field is the first character of the disk name and
245the unit number.
246If more than four disk drives are configured in the system,
247.Nm
248displays only the first four drives.
249To force
250.Nm
251to display specific drives, their names may be supplied on the command line.
252.It faults
253Trap/interrupt rate averages per second over last 5 seconds.
254.Pp
255.Bl -tag -width abcd -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 abcd -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 FILES
276.Bl -tag -width eeenymeeny -compact
277.It Pa /netbsd
278default kernel namelist
279.It Pa /dev/mem
280default memory file
281.El
282.Sh EXAMPLES
283The command
284.Dq Li vmstat -w 5
285will print what the system is doing every five
286seconds; this is a good choice of printing interval since this is how often
287some of the statistics are sampled in the system.
288Others vary every second and running the output for a while will make it
289apparent which are recomputed every second.
290.Sh SEE ALSO
291.Xr fstat 1 ,
292.Xr netstat 1 ,
293.Xr nfsstat 1 ,
294.Xr ps 1 ,
295.Xr systat 1 ,
296.Xr iostat 8 ,
297.Xr pstat 8
298.Pp
299The sections starting with
300.Dq Interpreting system activity
301in
302.%T Installing and Operating 4.3BSD .
303.Sh BUGS
304The
305.Fl c
306and
307.Fl w
308options are only available with the default output.
309.Pp
310The
311.Fl l ,
312.Fl U ,
313and
314.Fl u
315options are useful only if the system was compiled with support for UVM
316history.
317