NAME
vmstat — report virtual memory statistics
SYNOPSIS
vmstat
[-dnS]
[interval
[count]]
vmstat
-f
|
-s
|
-z
DESCRIPTION
The
vmstat
command reports certain statistics kept about process,
virtual memory, trap, and CPU activity.
It also can clear the accumulators in the kernel
sum
structure.
Options
vmstat
recognizes the following options:
- -d
Report disk transfer information as a separate section,
in the form of transfers per second.
- -n
Provide an output format
that is more easily viewed on an 80-column display device.
This format separates the default output into two groups:
virtual memory information and CPU data.
Each group is displayed as a separate line of output.
On multiprocessor systems,
this display format also provides CPU utilization on a per CPU basis
for the active processors.
- -S
Report the number of processes swapped in and out
(si
and
so)
instead of page reclaims and address translation faults
(re
and
at).
- interval
Display successive lines which are summaries over the last
interval
seconds.
The first line reported is for the time since a reboot and
each subsequent line is for the last interval only.
If
interval
is zero, the output is displayed once only.
If the
-d
option is specified, the column headers are repeated.
If
-d
is omitted, the column headers are not repeated.
The command
vmstat 5
prints what the system is doing every five seconds.
This is a good choice of printing interval since this is how often
some of the statistics are sampled in the system;
others vary every second.
- count
Repeat the summary statistics
count
times.
If
count
is omitted or zero, the output is repeated
until an interrupt or quit signal is received.
From the terminal, these are commonly
^C
and
^\,
respectively (see
stty(1)).
- -f
Report on the number of forks
and the number of pages of virtual memory involved since boot-up.
- -s
Print the total number of several kinds of paging-related events
from the kernel
sum
structure that have occurred since boot-up or since
vmstat
was last executed with the
-z
option.
- -z
Clear all accumulators in the kernel
sum
structure.
This option is restricted to the super user.
If none of these options is given,
vmstat
displays a one-line summary of the virtual memory activity
since boot-up or since the
-z
option was last executed.
Column Descriptions
The column headings and the meaning of each column are:
- procs
Information about numbers of processes in various states.
- r
In run queue
- b
Blocked for resources (I/O, paging, etc.)
- w
Runnable or short sleeper (< 20 secs) but swapped
- memory
Information about the usage of virtual and real memory.
Virtual pages are considered active if they belong to processes
that are running or have run in the last 20 seconds.
- avm
Active virtual pages
- free
Size of the free list
- page
Information about page faults and paging activity.
These are averaged each five seconds, and given in units per second.
- re
Page reclaims (without
-S)
- at
Address translation faults (without
-S)
- si
Processes swapped in (with
-S)
- so
Processes swapped out (with
-S)
- pi
Pages paged in
- po
Pages paged out
- fr
Pages freed per second
- de
Anticipated short term memory shortfall
- sr
Pages scanned by clock algorithm, per second
- faults
Trap/interrupt rate averages per second over last 5 seconds.
- in
Device interrupts per second (nonclock)
- sy
System calls per second
- cs
CPU context switch rate (switches/sec)
- cpu
Breakdown of percentage usage of CPU time for the active processors
- us
User time for normal and low priority processes
- sy
System time
- id
CPU idle
EXAMPLES
The following examples show the output for various command options.
For formatting purposes, some leading blanks have been deleted.
- 1.
Display the default output.
vmstat
procs memory page
faults cpu
r b w avm free re at pi po fr de sr
in sy cs us sy id
0 0 0 1158 511 0 0 0 0 0 0 0
111 18 7 0 0 100
- 2.
Add the disk tranfer information to the default output.
vmstat -d
procs memory page
faults cpu
r b w avm free re at pi po fr de sr
in sy cs us sy id
0 0 0 1158 511 0 0 0 0 0 0 0
111 18 7 0 0 100
Disk Transfers
device xfer/sec
c0t6d0 0
c0t1d0 0
c0t3d0 0
c0t5d0 0
- 3.
Display the default output in 80-column format.
vmstat -n
VM
memory page faults
avm free re at pi po fr de sr in sy cs
1158 430 0 0 0 0 0 0 0 111 18 7
CPU
cpu procs
us sy id r b w
0 0 100 0 0 0
- 4.
Replace the page reclaims and address translation faults with process swapping
in the default output.
vmstat -S
procs memory page
faults cpu
r b w avm free si so pi po fr de sr
in sy cs us sy id
0 0 0 1158 430 0 0 0 0 0 0 0
111 18 7 0 0 100
- 5.
Display the default output twice at five-second intervals.
Note that the headers are
not
repeated.
vmstat 5 2
procs memory page
faults cpu
r b w avm free re at pi po fr de sr
in sy cs us sy id
0 0 0 1158 456 0 0 0 0 0 0 0
111 18 7 0 0 100
0 0 0 1221 436 5 0 5 0 0 0 0
108 65 18 0 1 99
- 6.
Display the default output twice in 80-column format at five-second intervals.
Note that the headers are
not
repeated.
vmstat -n 5 2
VM
memory page faults
avm free re at pi po fr de sr in sy cs
1221 436 0 0 0 0 0 0 0 111 18 7
CPU
cpu procs
us sy id r b w
0 0 100 0 0 0
1221 435 2 0 2 0 0 0 0 109 35 17
0 1 99 0 0 0
- 7.
Display the default output and disk transfers twice
in 80-column format at five-second intervals.
Note that the headers
are
repeated.
vmstat -dn 5 2
VM
memory page faults
avm free re at pi po fr de sr in sy cs
1221 435 0 0 0 0 0 0 0 111 18 7
CPU
cpu procs
us sy id r b w
0 0 100 0 0 0
Disk Transfers
device xfer/sec
c0t6d0 0
c0t1d0 0
c0t3d0 0
c0t5d0 0
VM
memory page faults
avm free re at pi po fr de sr in sy cs
1219 425 0 0 0 0 0 0 0 111 54 15
CPU
cpu procs
us sy id r b w
1 8 92 0 0 0
Disk Transfers
device xfer/sec
c0t6d0 0
c0t1d0 0
c0t3d0 0
c0t5d0 0
- 8.
Display the number of forks and pages of virtual memory since boot-up.
vmstat -f
24558 forks, 1471595 pages, average= 59.92
- 9.
Display the counts of paging-related events.
vmstat -s
0 swap ins
0 swap outs
0 pages swapped in
0 pages swapped out
1344563 total address trans. faults taken
542093 page ins
2185 page outs
602573 pages paged in
4346 pages paged out
482343 reclaims from free list
504621 total page reclaims
124 intransit blocking page faults
1460755 zero fill pages created
404137 zero fill page faults
366022 executable fill pages created
71578 executable fill page faults
0 swap text pages found in free list
162043 inode text pages found in free list
196 revolutions of the clock hand
45732 pages scanned for page out
4859 pages freed by the clock daemon
36680636 cpu context switches
1497746186 device interrupts
1835626 traps
87434493 system calls
WARNINGS
Users of
vmstat
must not rely on the exact field widths and spacing of its output,
as these will vary depending on the system, the release of HP-UX, and
the data to be displayed.
AUTHOR
vmstat
was developed by the University of California,
Berkeley and HP.