System information

10 System Analysis and Tuning Guide
of the system at a glance. Use these tools first in order to get an overview and find out
which part of the system to examine further.
2.1.1 vmstat
vmstat collects information about processes, memory, I/O, interrupts and CPU. If
called without a sampling rate, it displays average values since the last reboot. When
called with a sampling rate, it displays actual samples:
Example2.1: vmstat Output on a Lightly Used Machine
tux@mercury:~> vmstat -a 2
procs -----------memory---------- ---swap-- -----io---- -system-- -----cpu-------
r b swpd free inact active si so bi bo in cs us sy id wa st
0 0 0 750992 570648 548848 0 0 0 1 8 9 0 0 100 0 0
0 0 0 750984 570648 548912 0 0 0 0 63 48 1 0 99 0 0
0 0 0 751000 570648 548912 0 0 0 0 55 47 0 0 100 0 0
0 0 0 751000 570648 548912 0 0 0 0 56 50 0 0 100 0 0
0 0 0 751016 570648 548944 0 0 0 0 57 50 0 0 100 0 0
Example2.2: vmstat Output on a Heavily Used Machine (CPU bound)
tux@mercury:~> vmstat 2
procs -----------memory----------- ---swap-- -----io---- -system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
32 1 26236 459640 110240 6312648 0 0 9944 2 4552 6597 95 5 0 0 0
23 1 26236 396728 110336 6136224 0 0 9588 0 4468 6273 94 6 0 0 0
35 0 26236 554920 110508 6166508 0 0 7684 27992 4474 4700 95 5 0 0 0
28 0 26236 518184 110516 6039996 0 0 10830 4 4446 4670 94 6 0 0 0
21 5 26236 716468 110684 6074872 0 0 8734 20534 4512 4061 96 4 0 0 0
TIP
The first line of the vmstat output always displays average values since the
last reboot.
The columns show the following:
r
Shows the number of processes in the run queue. These processes are waiting for
a free CPU slot to be executed. If the number of processes in this column is con-
stantly higher than the number of CPUs available, this is an indication of insuffi-
cient CPU power.