System information

14 System Analysis and Tuning Guide
and count. If filename, interval and count are not specified, sar attempts to generate
a report from /var/log/sa/saDD, where DD stands for the current day. This is
the default location to where sadc writes its data. Query multiple files with multiple
-f options.
sar 2 10 # on-the-fly report, 10 times every 2
seconds
sar -f ~/reports/sar_2010_05_03 # queries file sar_2010_05_03
sar # queries file from today in /var/log/sa/
cd /var/log/sa &&\
sar -f sa01 -f sa02 # queries files /var/log/sa/0[12]
Find examples for useful sar calls and their interpretation below. For detailed infor-
mation on the meaning of each column, please refer to the man (1) of sar. Also
refer to the man page for more options and reports—sar offers plenty of them.
CPU Utilization Report: sar
When called with no options, sar shows a basic report about CPU usage. On mul-
ti-processor machines, results for all CPUs are summarized. Use the option -P ALL
to also see statistics for individual CPUs.
mercury:~ # sar 10 5
Linux 2.6.31.12-0.2-default (mercury) 03/05/10 _x86_64_ (2 CPU)
14:15:43 CPU %user %nice %system %iowait %steal %idle
14:15:53 all 38.55 0.00 6.10 0.10 0.00 55.25
14:16:03 all 12.59 0.00 4.90 0.33 0.00 82.18
14:16:13 all 56.59 0.00 8.16 0.44 0.00 34.81
14:16:23 all 58.45 0.00 3.00 0.00 0.00 38.55
14:16:33 all 86.46 0.00 4.70 0.00 0.00 8.85
Average: all 49.94 0.00 5.38 0.18 0.00 44.50
If the value for %iowait (percentage of the CPU being idle while waiting for I/O) is
significantly higher than zero over a longer period of time, there is a bottleneck in the
I/O system (network or hard disk). If the %idle value is zero over a longer period of
time, your CPU(s) are working to full capacity.
Memory Usage Report: sar -r
Generate an overall picture of the system memory (RAM) by using the option -r:
mercury:~ # sar -r 10 5
Linux 2.6.31.12-0.2-default (mercury) 03/05/10 _x86_64_ (2 CPU)
16:12:12 kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit
16:12:22 548188 1507488 73.33 20524 64204 2338284 65.10