Monitoring system resources over time helps ensure your cPanel and/or Plesk server runs optimally, identifying potential bottlenecks or performance issues early. This guide explains how to install and use atop to log and view resource usage at set intervals.
What is atop?
atop is a performance monitor that captures detailed information about system resources such as CPU, memory, disk, and network usage.
With atop, you can monitor and analyze these metrics over time, making it easier to identify patterns and troubleshoot performance issues.
Step 1: Install and Set Up atop
- Connect to the Plesk server using SSH.
- Install the
atop
package:- On CentOS/RHEL-based distributions:
yum install atop
- On Debian/Ubuntu-based distributions:
apt-get install atop
- On CentOS/RHEL-based distributions:
- Set the monitoring interval to 60 seconds (default is 600 seconds):
- On CentOS/RHEL-based distributions:
sed -i 's/600/60/' /etc/sysconfig/atop
- On Debian/Ubuntu-based distributions:
sed -i 's/600/60/' /etc/default/atop
- On CentOS/RHEL-based distributions:
- Start the atop service:
service atop restart
Note: On Debian/Ubuntu, atop automatically starts logging via a cron job at midnight if it's not already running.
Step 2: Using atop to Monitor System Resource Logs
- List available atop log files:
ls -l /var/log/atop/
- To view collected data in a specific log file, run:
atop -r /var/log/atop/atop_*****
Replace
atop_*****
with the appropriate log file name from step 1. - Use the following hotkeys to navigate data:
t
- Move forwardShift + t
- Move backwardr
- Reset all counters
Note: See the atop man page for more hotkey options.
Disabling atop
- To stop atop, use:
service atop stop
- If using Debian/Ubuntu, remove the atop cron job:
rm -f /etc/cron.d/atop
Disclaimer
Always test these configurations in a staging environment and consult the latest documentation to confirm compatibility with your setup.