This article explains how to track system resource usage over a specific time period using atop.
Let us follow the steps:
- Installation & setup-
- Access Plesk server through SSH.
- Install the atop set-
- For distributions based on CentOS/RHEL-
# yum install atop - For distributions based on Debian/Ubuntu-
# apt-get install atop
- For distributions based on CentOS/RHEL-
- Adjust the monitoring interval to 60 seconds (default is 600 seconds)-
- For distributions based on CentOS/RHEL-
# sed -i ‘s/600/60/’ /etc/sysconfig/atop - For distributions based on Debian/Ubuntu-
# sed -i ‘s/600/60/’ /etc/default/atop
- For distributions based on CentOS/RHEL-
- Initiate the atop service-
# service atop restart
Note- For Debian/Ubuntu-based distributions, atop automatically generates a cron task, ensuring automatic logging initiation at midnight if it’s not already running.
- Usage-
- Display the generated atop log files-
# ls -l /var/log/atop/ - To inspect the gathered data, execute-
# atop -r /var/log/atop/atop_*****
where atop_***** is a file name from step 1. - Utilise hotkeys to switch between intervals-
- t – move forward
- Shift + t – move backwards
- r – reset all counters
- Display the generated atop log files-
- To disable atop, run-
# service atop stop
For Debian/Ubuntu-based distributions, delete the atop cron task-
# rm -f /etc/cron.d/atop
That is it! Hope you liked our article.