Sei sulla pagina 1di 5

VMSTAT

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

swap free re mf pi po fr de sr dd f0 s0 -1 0 0 0 0 0 0 0 0 0 403

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.

Table 19.1 vmstat Fields


Field

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).

memory/free Free memory


(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

User CPU time


(%).

cpu/sy

System
(kernel) CPU
time (%).

cpu/id

Idle + I/O wait


CPU time (%).

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

45 0 0 2887216 182104 3 707 449 6 455 0


9

faults

cpu

80 2 6 1 0

in

cs us sy id

1531 5797 983 61 30

58 0 0 2831312 46408 5 983 582 56 3211 0 492 0 0 0 0


31 0
55 0 0 2830944 56064 2 649 656 3 806 0 121 0 0 0 0

sy

1413 4797 1027 69


1441 4627 989 69 31 0

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 >

Potrebbero piacerti anche