IBM REDP-4285-00 User Manual

Page of 170
Chapter 2. Monitoring and benchmark tools 
41
Draft Document for Review May 4, 2007 11:35 am
4285ch02.fm
2.3  Monitoring tools
In this section, we discuss the monitoring tools. Most of the tools come with Enterprise Linux 
distributions. You should be familiar with the tools for better understanding of system behavior 
and performance tuning.
2.3.1  top
The top command shows actual process activity. By default, it displays the most 
CPU-intensive tasks running on the server and updates the list every five seconds. You can 
sort the processes by PID (numerically), age (newest first), time (cumulative time), and 
resident memory usage and time (time the process has occupied the CPU since startup).
Example 2-1   Example output from the top command
top - 02:06:59 up 4 days, 17:14,  2 users,  load average: 0.00, 0.00, 0.00
Tasks:  62 total,   1 running,  61 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.2% us,  0.3% sy,  0.0% ni, 97.8% id,  1.7% wa,  0.0% hi,  0.0% si
Mem:    515144k total,   317624k used,   197520k free,    66068k buffers
Swap:  1048120k total,       12k used,  1048108k free,   179632k cached
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
13737 root      17   0  1760  896 1540 R  0.7  0.2   0:00.05 top
  238 root       5 -10     0    0    0 S  0.3  0.0   0:01.56 reiserfs/0
    1 root      16   0   588  240  444 S  0.0  0.0   0:05.70 init
    2 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    4 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/1
    5 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/1
    6 root       5 -10     0    0    0 S  0.0  0.0   0:00.02 events/0
    7 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 events/1
    8 root       5 -10     0    0    0 S  0.0  0.0   0:00.09 kblockd/0
    9 root       5 -10     0    0    0 S  0.0  0.0   0:00.01 kblockd/1
   10 root      15   0     0    0    0 S  0.0  0.0   0:00.00 kirqd
   13 root       5 -10     0    0    0 S  0.0  0.0   0:00.02 khelper/0
   14 root      16   0     0    0    0 S  0.0  0.0   0:00.45 pdflush
   16 root      15   0     0    0    0 S  0.0  0.0   0:00.61 kswapd0
   17 root      13 -10     0    0    0 S  0.0  0.0   0:00.00 aio/0
   18 root      13 -10     0    0    0 S  0.0  0.0   0:00.00 aio/1
You can further modify the processes using renice to give a new priority to each process. If a 
process hangs or occupies too much CPU, you can kill the process (kill command). 
The columns in the output are: 
PID
Process identification.
USER
Name of the user who owns (and perhaps started) the process. 
PRI
Priority of the process. (See 1.1.4, “Process priority and nice level” on page 5 
for details.)
netperf
Network performance benchmark
Tool
Most useful tool function