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