xref: /freebsd/usr.bin/vmstat/vmstat.8 (revision d662d4b7016083b860047b1efd90e824ec269d5a)
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
33d662d4b7SKris Kennaway.\"	$Id: vmstat.8,v 1.13 1999/02/15 13:57:18 bde Exp $
349b50d902SRodney W. Grimes.\"
351c1f145fSMike Pritchard.Dd June 6, 1996
361c1f145fSMike Pritchard.Dt VMSTAT 8
371c1f145fSMike Pritchard.Os BSD 4
381c1f145fSMike Pritchard.Sh NAME
391c1f145fSMike Pritchard.Nm vmstat
401c1f145fSMike Pritchard.Nd report virtual memory statistics
411c1f145fSMike Pritchard.Sh SYNOPSIS
4233d83c83SMike Pritchard.Nm vmstat
43aeaa52dbSSteve Price.\" .Op Fl fimst
44218221f3SBruce Evans.Op Fl imsz
451c1f145fSMike Pritchard.Op Fl c Ar count
46aeaa52dbSSteve Price.Op Fl M Ar core
47aeaa52dbSSteve Price.Op Fl N Ar system
48aeaa52dbSSteve Price.Op Fl w Ar wait
498d2fbde5SJustin T. Gibbs.Op Fl n Ar devs
508d2fbde5SJustin T. Gibbs.Op Fl p Ar type,if,pass
511c1f145fSMike Pritchard.Op Ar disks
521c1f145fSMike Pritchard.Sh DESCRIPTION
531c1f145fSMike Pritchard.Nm Vmstat
549b50d902SRodney W. Grimesreports certain kernel statistics kept about process, virtual memory,
559b50d902SRodney W. Grimesdisk, trap and cpu activity.
561c1f145fSMike Pritchard.Pp
579b50d902SRodney W. GrimesThe options are as follows:
581c1f145fSMike Pritchard.Bl -tag -width indent
591c1f145fSMike Pritchard.It Fl c
609b50d902SRodney W. GrimesRepeat the display
611c1f145fSMike Pritchard.Ar count
629b50d902SRodney W. Grimestimes.
639b50d902SRodney W. GrimesThe first display is for the time since a reboot and each subsequent report
649b50d902SRodney W. Grimesis for the time period since the last display.
659b50d902SRodney W. GrimesIf no
661c1f145fSMike Pritchard.Ar wait
679b50d902SRodney W. Grimesinterval is specified, the default is 1 second.
689d16a728SMike Pritchard.\" .It Fl f
699d16a728SMike Pritchard.\" Report on the number
709d16a728SMike Pritchard.\" .Xr fork 2
719d16a728SMike Pritchard.\" and
729d16a728SMike Pritchard.\" .Xr vfork 2
739d16a728SMike Pritchard.\" system calls since system startup, and the number of pages of virtual memory
749d16a728SMike Pritchard.\" involved in each.
751c1f145fSMike Pritchard.It Fl i
769b50d902SRodney W. GrimesReport on the number of interrupts taken by each device since system
779b50d902SRodney W. Grimesstartup.
781c1f145fSMike Pritchard.It Fl M
791c1f145fSMike PritchardExtract values associated with the name list from the specified
801c1f145fSMike Pritchard.Ar core
811c1f145fSMike Pritchardinstead of the default
821c1f145fSMike Pritchard.Pa /dev/kmem .
831c1f145fSMike Pritchard.It Fl N
841c1f145fSMike PritchardExtract the name list from the specified
851c1f145fSMike Pritchard.Ar system
861c1f145fSMike Pritchardinstead of the default
871c1f145fSMike Pritchard.Pa /kernel .
881c1f145fSMike Pritchard.It Fl m
899b50d902SRodney W. GrimesReport on the usage of kernel dynamic memory listed first by size of
909b50d902SRodney W. Grimesallocation and then by type of usage.
918d2fbde5SJustin T. Gibbs.It Fl n
924faf42f3SKenneth D. MerryChange the maximum number of disks to display from the default of 2.
938d2fbde5SJustin T. Gibbs.It Fl p
948d2fbde5SJustin T. GibbsSpecify which types of devices to display.  There are three different
958d2fbde5SJustin T. Gibbscategories of devices:
968d2fbde5SJustin T. Gibbs
978d2fbde5SJustin T. Gibbs.Bl -tag -width indent -compact
988d2fbde5SJustin T. Gibbs.It device type:
998d2fbde5SJustin T. Gibbs.Bl -tag -width 123456789 -compact
1008d2fbde5SJustin T. Gibbs.It da
1018d2fbde5SJustin T. GibbsDirect Access devices
1028d2fbde5SJustin T. Gibbs.It sa
1038d2fbde5SJustin T. GibbsSequential Access devices
1048d2fbde5SJustin T. Gibbs.It printer
1058d2fbde5SJustin T. GibbsPrinters
1068d2fbde5SJustin T. Gibbs.It proc
1078d2fbde5SJustin T. GibbsProcessor devices
1088d2fbde5SJustin T. Gibbs.It worm
1098d2fbde5SJustin T. GibbsWrite Once Read Multiple devices
1108d2fbde5SJustin T. Gibbs.It cd
1118d2fbde5SJustin T. GibbsCD devices
1128d2fbde5SJustin T. Gibbs.It scanner
1138d2fbde5SJustin T. GibbsScanner devices
1148d2fbde5SJustin T. Gibbs.It optical
1158d2fbde5SJustin T. GibbsOptical Memory devices
1168d2fbde5SJustin T. Gibbs.It changer
1178d2fbde5SJustin T. GibbsMedium Changer devices
1188d2fbde5SJustin T. Gibbs.It comm
1198d2fbde5SJustin T. GibbsCommunication devices
1208d2fbde5SJustin T. Gibbs.It array
1218d2fbde5SJustin T. GibbsStorage Array devices
1228d2fbde5SJustin T. Gibbs.It enclosure
1238d2fbde5SJustin T. GibbsEnclosure Services devices
1248d2fbde5SJustin T. Gibbs.It floppy
1258d2fbde5SJustin T. GibbsFloppy devices
1268d2fbde5SJustin T. Gibbs.El
1278d2fbde5SJustin T. Gibbs.Pp
1288d2fbde5SJustin T. Gibbs.It interface:
1298d2fbde5SJustin T. Gibbs.Bl -tag -width 123456789 -compact
1308d2fbde5SJustin T. Gibbs.It IDE
1318d2fbde5SJustin T. GibbsIntegrated Drive Electronics devices
1328d2fbde5SJustin T. Gibbs.It SCSI
1338d2fbde5SJustin T. GibbsSmall Computer System Interface devices
1348d2fbde5SJustin T. Gibbs.It other
1358d2fbde5SJustin T. GibbsAny other device interface
1368d2fbde5SJustin T. Gibbs.El
1378d2fbde5SJustin T. Gibbs.Pp
1388d2fbde5SJustin T. Gibbs.It passthrough:
1398d2fbde5SJustin T. Gibbs.Bl -tag -width 123456789 -compact
1408d2fbde5SJustin T. Gibbs.It pass
1418d2fbde5SJustin T. GibbsPassthrough devices
1428d2fbde5SJustin T. Gibbs.El
1438d2fbde5SJustin T. Gibbs.El
1448d2fbde5SJustin T. Gibbs.Pp
1458d2fbde5SJustin T. GibbsThe user must specify at least one device type, and may specify at most
1468d2fbde5SJustin T. Gibbsone device type from each category.  Multiple device types in a single
1478d2fbde5SJustin T. Gibbsdevice type statement must be separated by commas.
1488d2fbde5SJustin T. Gibbs.Pp
1498d2fbde5SJustin T. GibbsAny number of
1508d2fbde5SJustin T. Gibbs.Fl p
1518d2fbde5SJustin T. Gibbsarguments may be specified on the command line.  All
1528d2fbde5SJustin T. Gibbs.Fl p
1538d2fbde5SJustin T. Gibbsarguments are ORed together to form a matching expression against which
1548d2fbde5SJustin T. Gibbsall devices in the system are compared.  Any device that fully matches
1558d2fbde5SJustin T. Gibbsany
1568d2fbde5SJustin T. Gibbs.Fl p
1578d2fbde5SJustin T. Gibbsargument will be included in the
1588d2fbde5SJustin T. Gibbs.Nm
1598d2fbde5SJustin T. Gibbsoutput, up to three devices, or the maximum number of devices specified
1608d2fbde5SJustin T. Gibbsby the user.
1611c1f145fSMike Pritchard.It Fl s
1629b50d902SRodney W. GrimesDisplay the contents of the
1631c1f145fSMike Pritchard.Em sum
1649b50d902SRodney W. Grimesstructure, giving the total number of several kinds of paging related
1659b50d902SRodney W. Grimesevents which have occurred since system startup.
1669d16a728SMike Pritchard.\" .It Fl t
1679d16a728SMike Pritchard.\" Report on the number of page in and page reclaims since system startup,
1689d16a728SMike Pritchard.\" and the amount of time required by each.
1691c1f145fSMike Pritchard.It Fl w
1709b50d902SRodney W. GrimesPause
1711c1f145fSMike Pritchard.Ar wait
1729b50d902SRodney W. Grimesseconds between each display.
1739b50d902SRodney W. GrimesIf no repeat
1741c1f145fSMike Pritchard.Ar count
1759b50d902SRodney W. Grimesis specified, the default is infinity.
176d662d4b7SKris Kennaway.It Fl z
177d662d4b7SKris KennawayReport on memory used by the kernel zone allocator, by zone.
1781c1f145fSMike Pritchard.El
1791c1f145fSMike Pritchard.Pp
1809b50d902SRodney W. GrimesBy default,
181495aeceaSPhilippe Charnier.Nm
1829b50d902SRodney W. Grimesdisplays the following information:
1831c1f145fSMike Pritchard.Pp
1841c1f145fSMike Pritchard.Bl -tag -width indent
1851c1f145fSMike Pritchard.It procs
1869b50d902SRodney W. GrimesInformation about the numbers of processes in various states.
1871c1f145fSMike Pritchard.Pp
1881c1f145fSMike Pritchard.Bl -tag -width indent -compact
1891c1f145fSMike Pritchard.It r
1901c1f145fSMike Pritchardin run queue
1911c1f145fSMike Pritchard.It b
1921c1f145fSMike Pritchardblocked for resources (i/o, paging, etc.)
1931c1f145fSMike Pritchard.It w
1941c1f145fSMike Pritchardrunnable or short sleeper (< 20 secs) but swapped
1951c1f145fSMike Pritchard.El
1961c1f145fSMike Pritchard.It memory
1979b50d902SRodney W. GrimesInformation about the usage of virtual and real memory.
1989b50d902SRodney W. GrimesVirtual pages (reported in units of 1024 bytes) are considered active if
1999b50d902SRodney W. Grimesthey belong to processes which are running or have run in the last 20
2009b50d902SRodney W. Grimesseconds.
2011c1f145fSMike Pritchard.Pp
2021c1f145fSMike Pritchard.Bl -tag -width indent -compact
2031c1f145fSMike Pritchard.It avm
2041c1f145fSMike Pritchardactive virtual pages
2051c1f145fSMike Pritchard.It fre
2061c1f145fSMike Pritchardsize of the free list
2071c1f145fSMike Pritchard.El
2081c1f145fSMike Pritchard.It page
2099b50d902SRodney W. GrimesInformation about page faults and paging activity.
2109b50d902SRodney W. GrimesThese are averaged each five seconds, and given in units per second.
2111c1f145fSMike Pritchard.Pp
2121c1f145fSMike Pritchard.Bl -tag -width indent -compact
2139d16a728SMike Pritchard.It flt
2149d16a728SMike Pritchardtotal number of page faults
2151c1f145fSMike Pritchard.It re
2161c1f145fSMike Pritchardpage reclaims (simulating reference bits)
2179d16a728SMike Pritchard.\" .It at
2189d16a728SMike Pritchard.\" pages attached (found in free list)
2191c1f145fSMike Pritchard.It pi
2201c1f145fSMike Pritchardpages paged in
2211c1f145fSMike Pritchard.It po
2221c1f145fSMike Pritchardpages paged out
2231c1f145fSMike Pritchard.It fr
2241c1f145fSMike Pritchardpages freed per second
2259d16a728SMike Pritchard.\" .It de
2269d16a728SMike Pritchard.\" anticipated short term memory shortfall
2271c1f145fSMike Pritchard.It sr
2281c1f145fSMike Pritchardpages scanned by clock algorithm, per-second
2291c1f145fSMike Pritchard.El
2301c1f145fSMike Pritchard.It disks
2319b50d902SRodney W. GrimesDisk operations per second (this field is system dependent).
2329b50d902SRodney W. GrimesTypically paging will be split across the available drives.
2338d2fbde5SJustin T. GibbsThe header of the field is the first two characters of the disk name and
2349b50d902SRodney W. Grimesthe unit number.
2358d2fbde5SJustin T. GibbsIf more than three disk drives are configured in the system,
236495aeceaSPhilippe Charnier.Nm
2378d2fbde5SJustin T. Gibbsdisplays only the first three drives, unless the user specifies the
2388d2fbde5SJustin T. Gibbs.Fl n
2398d2fbde5SJustin T. Gibbsargument to increase the number of drives displayed.  This will probably
2408d2fbde5SJustin T. Gibbscause the display to exceed 80 columns, however.
2419b50d902SRodney W. GrimesTo force
242495aeceaSPhilippe Charnier.Nm
2439b50d902SRodney W. Grimesto display specific drives, their names may be supplied on the command line.
2448d2fbde5SJustin T. Gibbs.Nm
2458d2fbde5SJustin T. Gibbsdefaults to show disks first, and then various other random devices in the
2468d2fbde5SJustin T. Gibbssystem to add up to three devices, if there are that many devices in the
2478d2fbde5SJustin T. Gibbssystem.  If devices are specified on the command line, or if a device type
2488d2fbde5SJustin T. Gibbsmatching pattern is specified (see above),
2498d2fbde5SJustin T. Gibbs.Nm
2508d2fbde5SJustin T. Gibbswill only display the given devices or the devices matching the pattern,
2518d2fbde5SJustin T. Gibbsand will not randomly select other devices in the system.
2521c1f145fSMike Pritchard.It faults
2539b50d902SRodney W. GrimesTrap/interrupt rate averages per second over last 5 seconds.
2541c1f145fSMike Pritchard.Pp
2551c1f145fSMike Pritchard.Bl -tag -width indent -compact
2561c1f145fSMike Pritchard.It in
2571c1f145fSMike Pritcharddevice interrupts per interval (including clock interrupts)
2581c1f145fSMike Pritchard.It sy
2591c1f145fSMike Pritchardsystem calls per interval
2601c1f145fSMike Pritchard.It cs
2611c1f145fSMike Pritchardcpu context switch rate (switches/interval)
2621c1f145fSMike Pritchard.El
2631c1f145fSMike Pritchard.It cpu
2649b50d902SRodney W. GrimesBreakdown of percentage usage of CPU time.
2651c1f145fSMike Pritchard.Pp
2661c1f145fSMike Pritchard.Bl -tag -width indent -compact
2671c1f145fSMike Pritchard.It us
2681c1f145fSMike Pritcharduser time for normal and low priority processes
2691c1f145fSMike Pritchard.It sy
2701c1f145fSMike Pritchardsystem time
2711c1f145fSMike Pritchard.It id
2721c1f145fSMike Pritchardcpu idle
2731c1f145fSMike Pritchard.El
2741c1f145fSMike Pritchard.El
2751c1f145fSMike Pritchard.Sh EXAMPLES
2761c1f145fSMike PritchardThe command:
2771c1f145fSMike Pritchard.Dl vmstat -w 5
2781c1f145fSMike Pritchardwill print what the system is doing every five
2799b50d902SRodney W. Grimesseconds; this is a good choice of printing interval since this is how often
2809b50d902SRodney W. Grimessome of the statistics are sampled in the system.
2819b50d902SRodney W. GrimesOthers vary every second and running the output for a while will make it
2829b50d902SRodney W. Grimesapparent which are recomputed every second.
2838d2fbde5SJustin T. Gibbs.Pp
2848d2fbde5SJustin T. GibbsThe command:
2858d2fbde5SJustin T. Gibbs.Dl vmstat -p da -p cd -w 1
2868d2fbde5SJustin T. Gibbswill tell vmstat to select the first three direct access or CDROM devices
2878d2fbde5SJustin T. Gibbsand display statistics on those devices, as well as other systems
2888d2fbde5SJustin T. Gibbsstatistics every second.
2891c1f145fSMike Pritchard.Sh FILES
2901c1f145fSMike Pritchard.Bl -tag -width /dev/kmemxxx -compact
2911c1f145fSMike Pritchard.It Pa /kernel
2921c1f145fSMike Pritcharddefault kernel namelist
2931c1f145fSMike Pritchard.It Pa /dev/kmem
2941c1f145fSMike Pritcharddefault memory file
2951c1f145fSMike Pritchard.El
2961c1f145fSMike Pritchard.Sh SEE ALSO
2971c1f145fSMike Pritchard.Xr fstat 1 ,
2981c1f145fSMike Pritchard.Xr netstat 1 ,
2991c1f145fSMike Pritchard.Xr nfsstat 1 ,
3001c1f145fSMike Pritchard.Xr ps 1 ,
3011c1f145fSMike Pritchard.Xr systat 1 ,
3021c1f145fSMike Pritchard.Xr iostat 8 ,
3031c1f145fSMike Pritchard.Xr pstat 8
3041c1f145fSMike Pritchard.Pp
3059b50d902SRodney W. GrimesThe sections starting with ``Interpreting system activity'' in
3061c1f145fSMike Pritchard.%T "Installing and Operating 4.3BSD" .
307aeaa52dbSSteve Price.Sh BUGS
3081c1f145fSMike PritchardThe
3091c1f145fSMike Pritchard.Fl c
3101c1f145fSMike Pritchardand
3111c1f145fSMike Pritchard.Fl w
3121c1f145fSMike Pritchardoptions are only available with the default output.
313