Archive for the tag 'SAR'

sar - Collect, report, or save system activity information.

To have sar read a particular data file, use the -f /var/log/sa/saDD option. You can select multiple files by using multiple -f options. Since many of sar’s reports are lengthy, you may want to pipe the output to a file.

To create a basic report showing CPU usage and I/O wait time percentage, use sar with no flags. It produces a report similar to this:

01:10:00 PM CPU %user %nice %system %iowait %idle
01:20:00 PM all 7.78 0.00 3.34 20.94 67.94
01:30:00 PM all 0.75 0.00 0.46 1.71 97.08
01:40:00 PM all 0.65 0.00 0.48 1.63 97.23
01:50:00 PM all 0.96 0.00 0.74 2.10 96.19
02:00:00 PM all 0.58 0.00 0.54 1.87 97.01
02:10:00 PM all 0.80 0.00 0.60 1.27 97.33
02:20:01 PM all 0.52 0.00 0.37 1.17 97.94
02:30:00 PM all 0.49 0.00 0.27 1.18 98.06
Average: all 1.85 0.00 0.44 2.56 95.14

“The %user and %system columns simply specify the amount of time the CPU spends in user and system mode. The %iowait and %idle columns are of interest to us when doing performance analysis. The %iowait column specifies the amount of time the CPU spends waiting for I/O requests to complete. The %idle column tells us how much useful work the CPU is doing. A %idle time near zero indicates a CPU bottleneck, while a high %iowait value indicates unsatisfactory disk performance.”

SBDavid

SAR or Sysstat

SAR or Sysstat

You can follow the below steps to install Sysstat Utilities which includes the “sar” command that is used to display your load average for the day.

1. Login to your server through SSH and login as root or su to the root user.

2. First just create a directory, or use one that you use to download temporary files.

cd /root/download

3. Download the rpm.

wget ftp.ibiblio.org/pub/linux/system/status/sysstat-5.0.2-1.i386.rpm

4. Install the rpm.

rpm -ivh sysstat-5.0.2-1.i386.rpm

5. You can set cronjobs for systat

cd /etc/cron.d
vi sysstat

Paste the following contents in it for recording load averages every 10 minutes.

# run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib/sa/sa1 1 1
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib/sa/sa2 -A

Save the file and exit vi.

chmod 755 sysstat

6. To look at your load averages. Type in:

sar

Or

sar -q

This produces a better layout. It will show the loads recorded every ten minutes since midnight the night before. And then it will show your day’s average at the very bottom.