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