Knowledgebase

Find frequently asked questions and setup guides by searching or by browsing the categories.

Install and Start atop

atop is not installed by default. On Debian and Ubuntu:

sudo apt install atop

On AlmaLinux and Rocky Linux, atop comes from the EPEL repository:

sudo dnf install epel-release
sudo dnf install atop

Start it with sudo atop. It refreshes every 10 seconds; to choose another interval, give it in seconds: sudo atop 2. Press q to quit. Run it with sudo so it can read every process.

Read the Screen

The top half describes the whole system, one resource per line. The bottom half lists processes, busiest first.

LineWhat it shows
PRCProcess count and CPU time in system and user mode.
CPU, cpuTotal CPU use, then each core.
CPLLoad averages.
MEM, SWPMemory and swap.
DSKBusy percentage and reads and writes per disk.
NETTraffic per network layer and interface.

atop colors a line when a resource is close to its limit, so a busy disk or full memory stands out. On a virtual server, a high steal value on the CPU line means the host gave the CPU to other work.

Keys for Each View

KeyView
gGeneral view (the default).
mMemory per process.
dDisk reads and writes per process.
nNetwork per process.
cFull command line of each process.
u, pTotals per user or per program.

Upper-case letters change the sort order: C sorts by CPU, M by memory, D by disk, and A by the busiest resource. The network view per process needs the optional netatop or netatop-bpf module, installed separately; without it, the per-process network figures are not available.

Keep History in /var/log/atop

The package includes a service that writes a snapshot of the system to a log file at a fixed interval, every 600 seconds (ten minutes) with the upstream default settings. Make sure it runs, together with the timer that starts a new file each day:

sudo systemctl enable --now atop
sudo systemctl enable --now atop-rotate.timer
ls /var/log/atop/

There is one file per day, named like atop_20261128, and the upstream default keeps 28 days. The interval and the number of days to keep are set in /etc/default/atop on Debian and Ubuntu and in /etc/sysconfig/atop on AlmaLinux and Rocky Linux. The files are compact, but check them with df and du on a small disk.

Replay a Past Slowdown

sudo atop -r /var/log/atop/atop_20261128 -b 0300

-r reads a log file and -b starts at a given time, written as hhmm (here 03:00). In replay mode, press t for the next snapshot and T for the previous one; all view keys work as in live mode. sudo atop -r with no file opens today's log.

A typical search: open the log at the time of the complaint, check which line is colored, switch to the matching view (m for memory, d for disk), and read the name of the process at the top.

Summary Reports with atopsar

atopsar prints the same log as a table, one row per interval, which is easier to scan for a whole day:

sudo atopsar -c -r /var/log/atop/atop_20261128
sudo atopsar -m -r /var/log/atop/atop_20261128
sudo atopsar -d -r /var/log/atop/atop_20261128

The flags select CPU, memory, and disk.

atop, top, or htop?

  • top: installed everywhere; shows CPU and memory per process right now.
  • htop: a friendlier top with colors, scrolling, and a process tree.
  • atop: adds disk and network per process and keeps history; the tool to use after the problem is over.

For quick checks, see how to list running processes in Linux. When atop points at one service, systemctl shows its state and its logs.

Was this answer helpful?
Loading...