Using sar you can monitor performance of various Linux subsystems (CPU, Memory, I/O..) in real time. Using sar, you can also collect all performance data on an on-going basis, store them, and do historical analysis to identify bottlenecks. This article explains how to install and configure sysstat package (which contains sar utility) and explains how to monitor the following Linux performance statistics using sar. This is the only guide you’ll need for sar utility. So, bookmark this for your future reference. First, make sure the latest version of sar is available on your system. Install it using any one of the following methods depending on your distribution. Download the latest version from sysstat download page. You can also use wget to download the Sysstat.
Note: Make sure to pass the option –enable-install-cron. This does the following automatically for you. If you don’t configure sysstat with this option, you have to do this ugly job yourself manually. After the ./configure, install it as shown below. Note: This will install sar and other systat utilities under /usr/local/bin Once installed, verify the sar version using “sar -V”. Version 10 is the current stable version of sysstat. Finally, make sure sar works. For example, the following gives the system CPU statistics 3 times (with 1 second interval).
Sar is part of the sysstat package.
I. Install and Configure Sysstat
Install Sysstat Package
sudo apt-get install sysstat
(or)
yum install sysstat
(or)
rpm -ivh sysstat-10.0.0-1.i586.rpmInstall Sysstat from Source
wget http://pagesperso-orange.fr/sebastien.godard/sysstat-10.0.0.tar.bz2
tar xvfj sysstat-10.0.0.tar.bz2
cd sysstat-10.0.0
./configure --enable-install-cron
make
make install$ sar -V
sysstat version 10.0.0
(C) Sebastien Godard (sysstat orange.fr)$ sar 1 3
Linux 2.6.18-194.el5PAE (dev-db) 03/26/2011 _i686_ (8 CPU)
01:27:32 PM CPU %user %nice %system %iowait %steal %idle
01:27:33 PM all 0.00 0.00 0.00 0.00 0.00 100.00
01:27:34 PM all 0.25 0.00 0.25 0.00 0.00 99.50
01:27:35 PM all 0.75 0.00 0.25 0.00 0.00 99.00
Average: all 0.33 0.00 0.17 0.00 0.00 99.50
- 47 Users Found This Useful