How To Monitor System Resource Usage with atop on a Linux Server Make it Rain Paper

  • atop
  • 0

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

  1. Connect to the Plesk server using SSH.
  2. Install the atop package:
    • On CentOS/RHEL-based distributions:
      yum install atop
    • On Debian/Ubuntu-based distributions:
      apt-get install atop
  3. 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
  4. 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

  1. List available atop log files:
    ls -l /var/log/atop/
  2. 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.

  3. Use the following hotkeys to navigate data:
    • t - Move forward
    • Shift + t - Move backward
    • r - Reset all counters

    Note: See the atop man page for more hotkey options.

Disabling atop

  1. To stop atop, use:
    service atop stop
  2. 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.


Did this answer help?

« Back