Freigeben über


Best Practices: Monitoring Linux VM utilization with sysstat

Sysstat is a very interesting option to enable system monitoring without sacrificing performance and disk storage. Some distributions have it installed but disabled by default, other distributions you have to install it manually.

With the steps provided in this article you can get sysstat up and running so you can have history data to analyze if you run into any performance issues.

Installing Sysstat

Debian/Ubuntu
sudo apt-get install sysstat

Redhat/CentOS/Oracle
sudo yum install sysstat

Enabling stat collection

Debian/Ubuntu sudo vi /etc/default/sysstat
change ENABLED=”false” to ENABLED=”true”

Redhat/CentOS/Oracle
sysstat is usually enabled by default so no extra steps are needed

Changing the collection interval from every 10 minutes to every 2 minutes
sudo vi /etc/cron.d/sysstat

By default these are the settings that you will see:
Debian/Ubuntu
5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1

Redhat/CentOS/Oracle */10 * * * * root /usr/lib64/sa/sa1 1 1

To have it setup to collect data every 2 minutes, change it to:

Debian/Ubuntu
*/2 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1

Redhat/CentOS/Oracle */2 * * * * root /usr/lib64/sa/sa1 1 1

Restarting sysstat Debian/Ubuntu sudo service sysstat restart

Redhat/CentOS/Oracle
sudo systemctl restart sysstat OR sudo service sysstat restart

For more information about sysstat tools:
https://sebastien.godard.pagesperso-orange.fr/documentation.html