(SAR)System Activity Report is used to real-time monitor the various Linux systems like centos, RHEL, Ubuntu, etc. It gives real-time monitoring report of CPU, Memory utilization & Disk IO operations. It collects all real-time performance data, stores them and allows us to historical analysis & identify the bottlenecks Here we will look how to install, configure the utility & perform few commands to understand server performance statistics
Following performance statistics can be derived using SAR command
- CPU usage
- Individual CPU usage
- Memory, Swap available & used
- I/O activities of the system
- Disk I/O activities
- Network usage & statics
- Load average data
- Generate sar report on data from specific time
So, let’s begin
Installation
- Installation on RHEL/Centos/Amazon Linux
yum install sysstat –y
chkconfig sysstat on
service sysstat start
- Installation on Ubuntu
apt-get install sysstat
update-rc.d sysstat defaults
service sysstat start
- Check installation status
Configuration of SAR utility
Here, we can specify the duration of log files i.e. how long my log files will be stored on server. Also we could specify the compressing technique, compressing duration etc.
- Configuration file in RHEL/Centos/Amazon Linux
cat /etc/sysconfig/sysstat - Configuration in Ubuntu
cat /etc/default/sysstat
- Crontab file on RHEL/Centos/Amazon Linux/Ubuntu
cat /etc/cron.d/sysstat
- We can see the log file in below location
cd /var/log/sa/
Hands-On
- CPU utilization
sar -u
- Memory utilization
sar -r
- Generate specific days wise CPU utilization report
cd /var/log/sa && sar -u -f sa19
- Generate specific day wise Memory utilization report
cd /var/log/sa && sar -r -f sa19
- Generate Network statistics report
sar –n ALL
- Generate Block device report
sar -d
- Real time Memory monitoring. Below command will generate memory utilization report by interval of 2 seconds with 5 records.
sar -r 2 5
- Generate Load average report
sar -q
- Generate and save report into a file
sar -r >> sar-mem.txt
- Generate disk I/O and transfer rate statistics
sar -b
- Generate swap statistics
sar -S
Contributed by : Sonali Shah