Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
vmstat provides a convenient summary of system activity as well. When you run vmstat for the first
time, the displayed result represents a summary of information since boot time. To obtain useful realtime statistics, run vmstat with a time step as follows:
vmstat 30
This tells vmstat to run every 30 seconds and to display the results on the screen as follows until you
type Ctrl+C to interrupt the command:
kthr
r b w
memory
page
disk
faults
cpu
in
sy
cs us sy id
0 0 0 596704 31592
96
61 2 0 98
0 0 0 595040 24624
2 12 0 0 0 0 0 1 0 0 0 404 104
62 0 0 99
0 0 0 595040 24624
2 11 0 0 0 0 0 1 0 0 0 413 147
79 0 1 99
NOTE
Disregard the first line of output. This is a summary of information since the system was booted.
The vmstat command outputs columns of information with a header across the top. Each field of
output is described in Table 19.1.
Description
kthr/r
Run queue
length.
kthr/b
Kernel threads
blocked while
waiting for I/O.
kthr/w
Idle processes
that have been
swapped.
memory/swap Free,
unreserved
swap space
(KB).
page/re
Pages
reclaimed from
the free list.
page/mf
Minor faults
(page in
memory but
not mapped).
If the page is
still in memory,
a minor fault
remaps the
page.
page/pi
Paged in from
swap (KB/s).
(When a page
is brought
back from the
swap device,
the process
will stop
execution and
wait. This
might affect
performance.)
page/po
Paged out to
swap (KB/s).
The page has
been written
and freed.
page/fr
Freed or
destroyed
(KB/s). This
column reports
the activity of
the page
scanner.
page/de
Anticipated
short-term
memory
shortfall (KB).
page/sr
Scan rate
(pages). This
number is not
reported as a
"rate" but as a
total number of
pages
scanned.
disk/s#
Disk activity
for disk # (disk
operations per
second).
faults/in
Interrupts per
second.
faults/sy
System calls
per second.
faults/cs
Context
switches per
second.
cpu/us
cpu/sy
System
(kernel) CPU
time (%).
cpu/id
NOTE
The free column in vmstat now really does mean memory that is free and not used by the page
cache. In the past, it gave unreliable results.
The column labeled r under the kthr section is the run queue of processes waiting to get on the
CPU(s). The id column is CPU idle time. If a 0 (zero) appears in this column, the system lacks the
CPU resources to keep up with the process demand. Here's an example of a system that lacks CPU
resources:
kthr
memory
page
r b w
swap
re mf pi po fr de sr m0 m1 m2 m3
free
disk
faults
cpu
80 2 6 1 0
in
cs us sy id
sy
See that the CPU idle time is zero, and the CPU is spending the majority of CPU time in user space
(see us column). Two approaches can be taken here: Add extra CPUs or look over the application
code to determine if the application can be opti
< Back Page 3 of 9 Next >