How to configure sysstat

The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.

How to configure sysstat

Context

Aerospike’s Collectinfo tool requires that sysstat be installed in order to retrieve useful system stats from iostat, mpstat and sar…

Installing 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 a 1 minute 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 minute for 10 counts. You can change to “sa1 5 120” to capture every 5 seconds or “sa1 2 300” for every two seconds. A higher frequency may impact performance.

Restart the sysstat service:

sudo systemctl restart sysstat.service

or

sudo service sysstat restart

Validate that the tools work:

run iostat

iostat -x 1

Output:

[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


Notes

Reference

Keywords

sar,sysstat,iostat

Timestamp

02/22/17