Add or change /etc/cron.d/sysstat to this. This creates a cron jobe to write file /tmp/outage_resource_log.txt that keeps minute-by-minute stats, sometimes useful in troubleshooting slowdowns. However, it’s not a great way to do things, it create a small, constant resource drag, so disable it when done troubleshooting.
# The first element of the path is a directory where the debian-sa1
# script is located
PATH=/usr/lib/sysstat:/usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin
# Activity reports every 10 minutes everyday
#ORIGINAL DEFAULT WAS 5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
#uncomment above line and comment out /tmp/outage_resource_log.txt lines to restore original functionality
* * * * * root date +"%Y-%m-%d %H:%M:%S" >> /tmp/outage_resource_log.txt
* * * * * root sar -u 1 1 >> /tmp/outage_resource_log.txt 2>&1
* * * * * root sar -r 1 1 >> /tmp/outage_resource_log.txt 2>&1
* * * * * root sar -d 1 1 >> /tmp/outage_resource_log.txt 2>&1
* * * * * root echo "---" >> /tmp/outage_resource_log.txt
# Additional run at 23:59 to rotate the statistics file
59 23 * * * root command -v debian-sa1 > /dev/null && debian-sa1 60 2
When this special logging isn’t active, if sysstat is installed, you can do sar -u -f /var/log/sysstat/saDD # Replace DD with the day of the month
to see a day’s 10-minute cpu stats.