xref: /freebsd/usr.bin/vmstat/vmstat.8 (revision 1c1f145f2be9f903ccf085e9f942fa18d6428899)
19b50d902SRodney W. Grimes.\" Copyright (c) 1986, 1993
29b50d902SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
39b50d902SRodney W. Grimes.\"
49b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
59b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions
69b50d902SRodney W. Grimes.\" are met:
79b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
89b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
99b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
109b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
119b50d902SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
129b50d902SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
139b50d902SRodney W. Grimes.\"    must display the following acknowledgement:
149b50d902SRodney W. Grimes.\"	This product includes software developed by the University of
159b50d902SRodney W. Grimes.\"	California, Berkeley and its contributors.
169b50d902SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
179b50d902SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
189b50d902SRodney W. Grimes.\"    without specific prior written permission.
199b50d902SRodney W. Grimes.\"
209b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
219b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
229b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
239b50d902SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
249b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
259b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
269b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
279b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
289b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
299b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
309b50d902SRodney W. Grimes.\" SUCH DAMAGE.
319b50d902SRodney W. Grimes.\"
329b50d902SRodney W. Grimes.\"	@(#)vmstat.8	8.1 (Berkeley) 6/6/93
339b50d902SRodney W. Grimes.\"
341c1f145fSMike Pritchard.Dd June 6, 1996
351c1f145fSMike Pritchard.Dt VMSTAT 8
361c1f145fSMike Pritchard.Os BSD 4
371c1f145fSMike Pritchard.Sh NAME
381c1f145fSMike Pritchard.Nm vmstat
391c1f145fSMike Pritchard.Nd report virtual memory statistics
401c1f145fSMike Pritchard.Sh SYNOPSIS
411c1f145fSMike Pritchard.Nm pstat
421c1f145fSMike Pritchard.Op Fl fimst
431c1f145fSMike Pritchard.Op Fl c Ar count
441c1f145fSMike Pritchard.Op Fl M core
451c1f145fSMike Pritchard.Op Fl N system
461c1f145fSMike Pritchard.Op Fl w wait
471c1f145fSMike Pritchard.Op Ar disks
481c1f145fSMike Pritchard.Sh DESCRIPTION
491c1f145fSMike Pritchard.Nm Vmstat
509b50d902SRodney W. Grimesreports certain kernel statistics kept about process, virtual memory,
519b50d902SRodney W. Grimesdisk, trap and cpu activity.
521c1f145fSMike Pritchard.Pp
539b50d902SRodney W. GrimesThe options are as follows:
541c1f145fSMike Pritchard.Bl -tag -width indent
551c1f145fSMike Pritchard.It Fl c
569b50d902SRodney W. GrimesRepeat the display
571c1f145fSMike Pritchard.Ar count
589b50d902SRodney W. Grimestimes.
599b50d902SRodney W. GrimesThe first display is for the time since a reboot and each subsequent report
609b50d902SRodney W. Grimesis for the time period since the last display.
619b50d902SRodney W. GrimesIf no
621c1f145fSMike Pritchard.Ar wait
639b50d902SRodney W. Grimesinterval is specified, the default is 1 second.
641c1f145fSMike Pritchard.It Fl f
659b50d902SRodney W. GrimesReport on the number
661c1f145fSMike Pritchard.Xr fork 2
679b50d902SRodney W. Grimesand
681c1f145fSMike Pritchard.Xr vfork 2
699b50d902SRodney W. Grimessystem calls since system startup, and the number of pages of virtual memory
709b50d902SRodney W. Grimesinvolved in each.
711c1f145fSMike Pritchard.It Fl i
729b50d902SRodney W. GrimesReport on the number of interrupts taken by each device since system
739b50d902SRodney W. Grimesstartup.
741c1f145fSMike Pritchard.It Fl M
751c1f145fSMike PritchardExtract values associated with the name list from the specified
761c1f145fSMike Pritchard.Ar core
771c1f145fSMike Pritchardinstead of the default
781c1f145fSMike Pritchard.Pa /dev/kmem .
791c1f145fSMike Pritchard.It Fl N
801c1f145fSMike PritchardExtract the name list from the specified
811c1f145fSMike Pritchard.Ar system
821c1f145fSMike Pritchardinstead of the default
831c1f145fSMike Pritchard.Pa /kernel .
841c1f145fSMike Pritchard.It Fl m
859b50d902SRodney W. GrimesReport on the usage of kernel dynamic memory listed first by size of
869b50d902SRodney W. Grimesallocation and then by type of usage.
871c1f145fSMike Pritchard.It Fl s
889b50d902SRodney W. GrimesDisplay the contents of the
891c1f145fSMike Pritchard.Em sum
909b50d902SRodney W. Grimesstructure, giving the total number of several kinds of paging related
919b50d902SRodney W. Grimesevents which have occurred since system startup.
921c1f145fSMike Pritchard.It Fl t
939b50d902SRodney W. GrimesReport on the number of page in and page reclaims since system startup,
949b50d902SRodney W. Grimesand the amount of time required by each.
951c1f145fSMike Pritchard.It Fl w
969b50d902SRodney W. GrimesPause
971c1f145fSMike Pritchard.Ar wait
989b50d902SRodney W. Grimesseconds between each display.
999b50d902SRodney W. GrimesIf no repeat
1001c1f145fSMike Pritchard.Ar count
1019b50d902SRodney W. Grimesis specified, the default is infinity.
1021c1f145fSMike Pritchard.El
1031c1f145fSMike Pritchard.Pp
1049b50d902SRodney W. GrimesBy default,
1051c1f145fSMike Pritchard.Nm vmstat
1069b50d902SRodney W. Grimesdisplays the following information:
1071c1f145fSMike Pritchard.Pp
1081c1f145fSMike Pritchard.Bl -tag -width indent
1091c1f145fSMike Pritchard.It procs
1109b50d902SRodney W. GrimesInformation about the numbers of processes in various states.
1111c1f145fSMike Pritchard.Pp
1121c1f145fSMike Pritchard.Bl -tag -width indent -compact
1131c1f145fSMike Pritchard.It r
1141c1f145fSMike Pritchardin run queue
1151c1f145fSMike Pritchard.It b
1161c1f145fSMike Pritchardblocked for resources (i/o, paging, etc.)
1171c1f145fSMike Pritchard.It w
1181c1f145fSMike Pritchardrunnable or short sleeper (< 20 secs) but swapped
1191c1f145fSMike Pritchard.El
1201c1f145fSMike Pritchard.It memory
1219b50d902SRodney W. GrimesInformation about the usage of virtual and real memory.
1229b50d902SRodney W. GrimesVirtual pages (reported in units of 1024 bytes) are considered active if
1239b50d902SRodney W. Grimesthey belong to processes which are running or have run in the last 20
1249b50d902SRodney W. Grimesseconds.
1251c1f145fSMike Pritchard.Pp
1261c1f145fSMike Pritchard.Bl -tag -width indent -compact
1271c1f145fSMike Pritchard.It avm
1281c1f145fSMike Pritchardactive virtual pages
1291c1f145fSMike Pritchard.It fre
1301c1f145fSMike Pritchardsize of the free list
1311c1f145fSMike Pritchard.El
1321c1f145fSMike Pritchard.It page
1339b50d902SRodney W. GrimesInformation about page faults and paging activity.
1349b50d902SRodney W. GrimesThese are averaged each five seconds, and given in units per second.
1351c1f145fSMike Pritchard.Pp
1361c1f145fSMike Pritchard.Bl -tag -width indent -compact
1371c1f145fSMike Pritchard.It re
1381c1f145fSMike Pritchardpage reclaims (simulating reference bits)
1391c1f145fSMike Pritchard.It at
1401c1f145fSMike Pritchardpages attached (found in free list)
1411c1f145fSMike Pritchard.It pi
1421c1f145fSMike Pritchardpages paged in
1431c1f145fSMike Pritchard.It po
1441c1f145fSMike Pritchardpages paged out
1451c1f145fSMike Pritchard.It fr
1461c1f145fSMike Pritchardpages freed per second
1471c1f145fSMike Pritchard.It de
1481c1f145fSMike Pritchardanticipated short term memory shortfall
1491c1f145fSMike Pritchard.It sr
1501c1f145fSMike Pritchardpages scanned by clock algorithm, per-second
1511c1f145fSMike Pritchard.El
1521c1f145fSMike Pritchard.It disks
1539b50d902SRodney W. GrimesDisk operations per second (this field is system dependent).
1549b50d902SRodney W. GrimesTypically paging will be split across the available drives.
1559b50d902SRodney W. GrimesThe header of the field is the first character of the disk name and
1569b50d902SRodney W. Grimesthe unit number.
1579b50d902SRodney W. GrimesIf more than four disk drives are configured in the system,
1581c1f145fSMike Pritchard.Nm vmstat
1599b50d902SRodney W. Grimesdisplays only the first four drives.
1609b50d902SRodney W. GrimesTo force
1611c1f145fSMike Pritchard.Nm vmstat
1629b50d902SRodney W. Grimesto display specific drives, their names may be supplied on the command line.
1631c1f145fSMike Pritchard.It faults
1649b50d902SRodney W. GrimesTrap/interrupt rate averages per second over last 5 seconds.
1651c1f145fSMike Pritchard.Pp
1661c1f145fSMike Pritchard.Bl -tag -width indent -compact
1671c1f145fSMike Pritchard.It in
1681c1f145fSMike Pritcharddevice interrupts per interval (including clock interrupts)
1691c1f145fSMike Pritchard.It sy
1701c1f145fSMike Pritchardsystem calls per interval
1711c1f145fSMike Pritchard.It cs
1721c1f145fSMike Pritchardcpu context switch rate (switches/interval)
1731c1f145fSMike Pritchard.El
1741c1f145fSMike Pritchard.It cpu
1759b50d902SRodney W. GrimesBreakdown of percentage usage of CPU time.
1761c1f145fSMike Pritchard.Pp
1771c1f145fSMike Pritchard.Bl -tag -width indent -compact
1781c1f145fSMike Pritchard.It us
1791c1f145fSMike Pritcharduser time for normal and low priority processes
1801c1f145fSMike Pritchard.It sy
1811c1f145fSMike Pritchardsystem time
1821c1f145fSMike Pritchard.It id
1831c1f145fSMike Pritchardcpu idle
1841c1f145fSMike Pritchard.El
1851c1f145fSMike Pritchard.El
1861c1f145fSMike Pritchard.Sh EXAMPLES
1871c1f145fSMike PritchardThe command:
1881c1f145fSMike Pritchard.Dl vmstat -w 5
1891c1f145fSMike Pritchardwill print what the system is doing every five
1909b50d902SRodney W. Grimesseconds; this is a good choice of printing interval since this is how often
1919b50d902SRodney W. Grimessome of the statistics are sampled in the system.
1929b50d902SRodney W. GrimesOthers vary every second and running the output for a while will make it
1939b50d902SRodney W. Grimesapparent which are recomputed every second.
1941c1f145fSMike Pritchard.Sh FILES
1951c1f145fSMike Pritchard.Bl -tag -width /dev/kmemxxx -compact
1961c1f145fSMike Pritchard.It Pa /kernel
1971c1f145fSMike Pritcharddefault kernel namelist
1981c1f145fSMike Pritchard.It Pa /dev/kmem
1991c1f145fSMike Pritcharddefault memory file
2001c1f145fSMike Pritchard.El
2011c1f145fSMike Pritchard.Sh SEE ALSO
2021c1f145fSMike Pritchard.Xr fstat 1 ,
2031c1f145fSMike Pritchard.Xr netstat 1 ,
2041c1f145fSMike Pritchard.Xr nfsstat 1 ,
2051c1f145fSMike Pritchard.Xr ps 1 ,
2061c1f145fSMike Pritchard.Xr systat 1 ,
2071c1f145fSMike Pritchard.Xr iostat 8 ,
2081c1f145fSMike Pritchard.Xr pstat 8
2091c1f145fSMike Pritchard.Pp
2109b50d902SRodney W. GrimesThe sections starting with ``Interpreting system activity'' in
2111c1f145fSMike Pritchard.%T "Installing and Operating 4.3BSD" .
2129b50d902SRodney W. Grimes.SH BUGS
2131c1f145fSMike PritchardThe
2141c1f145fSMike Pritchard.Fl c
2151c1f145fSMike Pritchardand
2161c1f145fSMike Pritchard.Fl w
2171c1f145fSMike Pritchardoptions are only available with the default output.
218