This chapter describes procedures for monitoring system performance by using the vmstat, iostat, df, andsar commands. This is a list of the step-by-step instructions in this chapter.
The following example shows the vmstat display of statistics gathered at five-second intervals.
$ vmstat 5
procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr f0 s3 -- -- in sy cs us sy id
0 0 8 28312 668 0 9 2 0 1 0 0 0 1 0 0 10 61 82 1 2 97
0 0 3 31940 248 0 10 20 0 26 0 27 0 4 0 0 53 189 191 6 6 88
0 0 3 32080 288 3 19 49 6 26 0 15 0 9 0 0 75 415 277 6 15 79
0 0 3 32080 256 0 26 20 6 21 0 12 1 6 0 0 163 110 138 1 3 96
0 1 3 32060 256 3 45 52 28 61 0 27 5 12 0 0 195 191 223 7 11 82
0 0 3 32056 260 0 1 0 0 0 0 0 0 0 0 0 4 52 84 0 1 99
Category
|
Field Name
|
Description
|
procs
|
|
Reports the following states:
|
|
r
|
The number of kernel threads in the dispatch queue
|
|
b
|
Blocked kernel threads waiting for resources
|
|
w
|
Swapped out LWPs waiting for processing resources to finish
|
memory
|
|
Reports on usage of real and virtual memory:
|
|
swap
|
Available swap space
|
|
free
|
Size of the free list
|
page
|
|
Reports on page faults and paging activity, in units per second:
|
|
re
|
Pages reclaimed
|
|
mf
|
Minor and major faults
|
|
pi
|
Kbytes paged in
|
|
po
|
Kbytes paged out
|
|
fr
|
Kbytes freed
|
|
de
|
Anticipated memory needed by recently swapped-in processes
|
|
sr
|
Pages scanned by page daemon (not currently in use). If sr does not equal zero, the page daemon has been running.
|
disk
|
|
Reports the number of disk operations per second, showing data on up to four disks
|
faults
|
|
Reports the trap/interrupt rates (per second):
|
|
in
|
Interrupts per second
|
|
sy
|
System calls per second
|
|
cs
|
CPU context switch rate
|
cpu
|
|
Reports on the use of CPU time:
|
|
us
|
User time
|
|
sy
|
System time
|
|
id
|
Idle time
|
Run vmstat -s to show the total of various system events that have taken place since the system was last booted.
0 swap ins
0 swap outs
0 pages swapped in
0 pages swapped out
409376480 total address trans. faults taken
3075036 page ins
2601555 page outs
3812452 pages paged in
6525552 pages paged out
11007609 total reclaims
10927650 reclaims from free list
0 micro (hat) faults
409376480 minor (as) faults
2957386 major faults
102738273 copy-on-write faults
61711047 zero fill page faults
1002562077 pages examined by the clock daemon
7881 revolutions of the clock hand
16716370 pages freed by the clock daemon
4999048 forks
1138206 vforks
5747009 execs
741660225 cpu context switches
736047593 device interrupts
528054538 traps
2496638575 system calls
430283487 total name lookups (cache hits 95%)
81727 toolong
10484677 user cpu
9528364 system cpu
443762786 idle cpu
16281790 wait cpu
Run vmstat -S to show swapping statistics.
procs memory page disk faults cpu
r b w swap free si so pi po fr de sr m1 m3 m4 m5 in sy cs us sy id
0 0 0 8512 888 0 0 12 21 55 0 417 1 0 0 0 206 1040 308 2 2 96
si = Average number of LWPs swapped in per second
so = Number of whole processes swapped out
You can display disk activity information by using the iostat command with a time interval. The following example shows disk statistics gathered every five seconds.
iostat 5
tty md1 md3 md4 md5 cpu
tin tout kps tps serv kps tps serv kps tps serv kps tps serv us sy wt id
0 2 10 1 28 2 0 22 0 0 0 1 0 10 2 2 3 92
0 47 58 7 39 16 2 34 0 0 0 0 0 0 0 2 19 78
0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 98
0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 99
0 16 2 0 22 0 0 0 0 0 0 0 0 0 2 3 1 95
0 24 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 98
For Each ...
|
Field Name
|
Description
|
Terminal
|
|
|
|
tin
|
Number of characters in the terminal input queue
|
|
tout
|
Number of characters in the terminal output queue
|
Disk
|
|
|
|
bps
|
Blocks per second
|
|
tps
|
Transactions per second
|
|
serv
|
Average service time, in milliseconds
|
CPU
|
|
|
|
us
|
In user mode
|
|
sy
|
In system mode
|
|
wt
|
Waiting for I/O
|
|
id
|
Idle
|
Run iostat -xtc to get extended disk statistics. This command displays a line of output for each disk.
extended device statistics tty cpu
device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy wt id
md1 0.4 0.9 3.6 6.9 0.0 0.0 27.7 1 1 0 2 2 2 3 92
md3 0.1 0.2 1.0 1.3 0.0 0.0 21.7 0 0
md4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
md5 0.0 0.0 0.7 0.0 0.0 0.0 9.9 0 0
md8 0.8 0.3 6.7 14.2 0.0 0.0 13.1 0 1
md10 0.2 0.9 1.8 6.8 0.0 0.0 15.5 0 1
md11 0.2 0.9 1.8 6.8 0.0 0.0 14.8 0 1
md30 0.0 0.2 0.5 1.3 0.0 0.0 11.4 0 0
md31 0.0 0.2 0.5 1.3 0.0 0.0 10.2 0 0
md40 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
md41 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
md50 0.0 0.0 0.4 0.0 0.0 0.0 9.4 0 0
md51 0.0 0.0 0.4 0.0 0.0 0.0 7.3 0 0
md80 0.4 0.3 3.3 14.2 0.0 0.0 10.3 0 0
md81 0.4 0.3 3.3 14.2 0.0 0.0 11.7 0 1
sd0 0.6 2.1 6.0 22.8 0.0 0.0 16.3 0 3
sd1 0.6 2.1 6.0 22.8 0.0 0.0 15.2 0 2
Field Name
|
Description
|
r/s
|
Reads per second
|
w/s
|
Writes per second
|
Kr/s
|
Kbytes read per second
|
Kw/s
|
Kbytes written per second
|
wait
|
Average number of transactions waiting for service (queue length)
|
actv
|
Average number of transactions actively being serviced
|
svc_t
|
Average service time, in milliseconds
|
%w
|
Percentage of time the queue is not empty
|
%b
|
Percentage of time the disk is busy
|
Display CPU utilization with the sar -u command. (The sar command without any options is equivalent to sar -u.) At any given moment, the processor is either busy or idle. When busy, the processor is in either user or system mode. When idle, the processor is either waiting for I/O completion or "sitting still" with no work to do.
Measure CPU utilization during 5 secs one time.
sar -u 5 1
Measure CPU utilization during 60 secs 1440 times and write result in file sar.log.
sar -u -o sar.log 60 1440
To later review disk and tape activity from that period:
sar -d -f sar.log
Field Name
|
Description
|
%sys
|
Lists the percentage of time that the processor is in system mode
|
%user
|
Lists the percentage of time that the processor is in user mode
|
%wio
|
Lists the percentage of time the processor is idle and waiting for I/O completion
|
%idle
|
Lists the percentage of time the processor is idle and is not waiting for I/O
|
A high %wio generally means a disk slowdown has occurred.
No comments:
Post a Comment