Articles in this section

How to set up sysstat

Context

Aerospike’s Collectinfo tool requires that sysstat be installed in order to retrieve useful system stats from iostat, mpstat and sar. These tools may also be useful individually for diagnosing system-level issues.

Method

Install sysstat binaries

Ubuntu and Debian systems

sudo apt-get -y install sysstat

CentOS and RHEL systems

sudo yum -y install sysstat


Edit sysstat cron file and set to appropriate interval

vi /etc/cron.d/sysstat


cat /etc/cron.d/sysstat
# Run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib64/sa/sa1 60 10
The above will run the cron job every 10 minutes with sa1 running every 60 seconds for 10 counts, completely covering the 10-minute interval. If you need finer-grained monitoring, you can set the interval lower as long as you increase the count proportionally so that each invocation of sa1 covers the 600 seconds with no gaps or overlaps. EG, "sa1 5 120" will capture stats every 5 seconds, "sa1 2 300" will capture them every 2 seconds, etc. Setting the interval lower than 2 seconds may impact performance of the system.
 

Restart the sysstat service

sudo systemctl restart sysstat.service
or
sudo service sysstat restart
as appropriate for your system.

 

Validate that the tools work

Run iostat

iostat -x 1

Output example

[vagrant@localhost ~]$ iostat -x 1
Linux 2.6.32-642.11.1.el6.x86_64 (localhost.localdomain)       03/08/2017      _x86_64_        (2 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           1.49    0.00    4.63    2.48    0.00   91.40

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda              30.48    41.42  236.54    4.72 52537.04   368.96   219.29     0.14    0.58    0.57    0.66   0.33   7.92
dm-0              0.00     0.00  260.39   46.08 52492.05   368.68   172.48     0.24    0.79    0.60    1.88   0.26   7.89
dm-1              0.00     0.00    1.44    0.00    11.53     0.00     8.00     0.00    0.21    0.21    0.00   0.11   0.02

(the devices on your system may vary).


Notes

External references:
Ubuntu/Debian: https://www.crybit.com/sysstat-sar-on-ubuntu-debian/
CentOS/RHEL: https://www.server-world.info/en/note?os=CentOS_6&p=sysstat

Applies To Earliest Version

Pre 4.9

Applies To Latest Version

Current Version
Was this article helpful?
0 out of 0 found this helpful