How to track system resource usage over a specific time period using atop

November 8, 2023 / How-to Guide

This article explains how to track system resource usage over a specific time period using atop.

Let us follow the steps:

  1. Installation & setup-
    1. Access Plesk server through SSH.
    2. Install the atop set-
      1. For distributions based on CentOS/RHEL-
        # yum install atop
      2. For distributions based on Debian/Ubuntu-
        # apt-get install atop
    3. Adjust the monitoring interval to 60 seconds (default is 600 seconds)-
      1. For distributions based on CentOS/RHEL-
        # sed -i ‘s/600/60/’ /etc/sysconfig/atop
      2. For distributions based on Debian/Ubuntu-
        # sed -i ‘s/600/60/’ /etc/default/atop
    4. 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.
  2. Usage-
    1. Display the generated atop log files-
      # ls -l /var/log/atop/
    2. To inspect the gathered data, execute-
      # atop -r /var/log/atop/atop_*****
      where atop_***** is a file name from step 1.
    3. Utilise hotkeys to switch between intervals-
      1. t – move forward
      2. Shift + t – move backwards
      3. r – reset all counters
  3. 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.

After tracking system resources, check detailed usage history in cPanel. Learn How to View your Resource usage History in cPanel

Spread the love