Historical resource usage and load averages can be viewed using the "sar" utility, which should exist by default on all cPanel servers from the sysstat package. The stats are collected when sysstat runs from cron (/etc/cron.d/sysstat). If the crond service is not running, sysstat will not be able to collect historical statistics.
To view recent resource usage histories from sar, you can provide the path to the file that corresponds with the date of the stats.
For example, if you wanted to view the load averages for your server from the 25th of the month, you would run this command:
[root@host ~]$ sar -q -f /var/log/sa/sa25
The command above uses the '-q' flag to specify that load average information is wanted, and the '-f' flag to specify which sar file (day of the month) to read the data from. Note that sar may not have historical data for every day of the month.
If you do not provide the day in the sar command it will provide metrics for today. For example, the command below would show the load average for today:
[root@host ~]$ sar -q
Some commonly needed metrics and their sar commands are provided below.
Check CPU usage: none
[root@host ~]$ sar
Check memory usage:
[root@host ~]$ sar -r
Check disk usage:
[root@host ~]$ sar -dp
Check load Averages:
[root@host ~]$ sar -q
To help determine the source of the load, compare the times where the load averages are elevated against the other metrics. For example, if the commit percentage listed in sar -r is significantly higher than 100%, this indicates that the server was running out of memory at that time.
The following command will display the manual for the sar command. It will contain information on the flags and their usage.
[root@host ~]$ man sar
Server load investigations may require the assistance of a qualified System Administrator. If you do not have a System Administrator, we provide a listing of System Administrators here.
Comments
0 comments
Article is closed for comments.