|
|
Quick system tuning reference ``Diagnosing performance problems'' summarizes the symptoms and possible solutions for some important performance problems. Note that the measured values represent averages over time. Suggested critical values may not be suitable for all systems. For example, you may be able to tolerate a system that is paging out if this is not impacting the performance of the rest of the system seriously.
Diagnosing performance problems
Insufficient CPU power at high load | Possible solutions |
---|---|
[mp]sar -q shows runq-sz > 2
[mp]sar -u shows %idle < 20% on multiuser system [mp]sar -u shows %idle < 5% on dedicated database server Additionally for SMP: mpsar -q shows %runocc > 90% cpusar -u shows %idle < 20% on any CPU of multiuser system cpusar -u shows %idle < 5% on any CPU of dedicated database server |
Measures that can be taken include:
|
Excessive paging out or swapping | Possible solutions |
---|---|
[mp]sar -p shows rclm/s >> 0
[mp]sar -q shows %swpocc > 20% [mp]sar -w shows swpot/s > 1 swap -l shows free < 50% of blocks |
Increase free memory until swapping does not occur by:
|
Poor disk performance | Possible solutions |
---|---|
[mp]sar -u shows %wio > 15%
[mp]sar -d shows avque >> 1 and %busy > 80% |
Increase disk performance by:
|
Poor buffer cache performance | Possible solutions |
---|---|
[mp]sar -b shows %rcache < 90% and %wcache < 65% |
Improve buffer cache performance by:
|
Poor namei cache performance | Possible solutions |
---|---|
[mp]sar -n shows hit % < 65% |
Increase namei cache hit rate by:
|
Fragmented filesystem | Possible solutions |
---|---|
df -v shows blocks %used > 90% |
Reduce the number of disk blocks used by:
|
Reduce fragmentation by:
| |
Kernel tables too small | Possible solutions |
---|---|
error messages displayed on console
[mp]sar -v shows ov > 0 (overflows) | Allow table sizes to grow dynamically; for example, set MAX_PROC to 0 for the process table |
To record system activity
to a file for later analysis,
use the -o option of
sar(ADM)
on a single processor system, and of
mpsar(ADM)
on a multiprocessor system.
Take the measurements over a period of at least an hour
with a sampling interval sufficiently small
to capture the level of detail which you are interested in.
Record the system's activity at varying levels of loading so that
you can identify when bottlenecks are appearing.
Attributes of a well-tuned multiuser system
CPU performance | Explanation |
---|---|
[cpu]sar -u shows %idle > 20% | Some idle time on each CPU at high load |
[mp]sar -q shows runq-sz < 2 | Few processes waiting to run |
mpsar -q shows %runocc < 90% (SMP only) | Run queue is not continually occupied |
Memory performance | Explanation |
---|---|
[mp]sar -p shows rclm/s 0 | Little or no swapping or paging out activity |
[mp]sar -w shows swpot/s 0 | Little or no activity on the swap device(s) |
[mp]sar -q shows swpq-sz 0 and %swpocc 0% | No swapped-out runnable processes |
[mp]sar -r shows freemem >> GPGSHI and freeswp constant | Ample free memory and swap space |
Disk I/O performance | Explanation |
---|---|
[cpu]sar -u shows %wio < 15% | Little time spent waiting for I/O to complete |
[mp]sar -b shows %rcache > 90% and %wcache > 65% | Good hit rate for reading and writing to the buffer cache |
[mp]sar -d shows avque 1 | Low average number of disk requests queued |
[mp]sar -n shows hit % > 65% | Good hit rate for namei cache |
Attributes of a well-tuned dedicated database server system
CPU performance | Explanation |
---|---|
[cpu]sar -u shows %idle > 5% | Some idle time on each CPU at high load |
[mp]sar -q shows runq-sz < 2 | Few processes waiting to run |
mpsar -q shows %runocc < 90% (SMP only) | Run queue is not continually occupied |
Memory performance | Explanation |
---|---|
[mp]sar -p shows rclm/s 0 | Little or no swapping or paging out activity |
[mp]sar -w shows swpot/s 0 | Little or no activity on the swap device(s) |
[mp]sar -q shows swpq-sz 0 and %swpocc 0% | No swapped-out runnable processes |
[mp]sar -r shows freemem GPGSHI and freeswp constant | Little excess free memory; allow the database to use any excess memory by increasing its internal work area. |
Disk I/O performance | Explanation |
---|---|
[cpu]sar -u shows %wio < 15% | Little time spent waiting for I/O to complete |
[mp]sar -d shows avque 1 | Low average number of disk requests queued |