Install sysstat
Step 1. Install sysstat
sudo apt-get install sysstat
Step 2. Enable stat collection
sudo vi /etc/default/sysstat
#change ENABLED=”false” to ENABLED=”true”
#save the file
Step 3. Change the collection interval.
Change from every 10 minutes to every 2 minutes.
sudo vi /etc/cron.d/sysstat
# Change
# 5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
# To
# */2 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
# save the file
Step 4. Restart sysstat
sudo service sysstat restart
Step 5. If you want to see all statistics you can type:
sar -A