atop

On this page 7

atop is an interactive performance monitor for Linux that reports the load on every critical hardware resource, namely CPU, memory, disk and network, both for the system as a whole and for each individual process. In Linux monitoring it is distinguished from top and htop by two capabilities: it highlights saturated resources automatically, and it can write compressed raw logs that are replayed later, so an administrator can examine what happened at three in the morning as if watching it live.

The tool was written by Gerlof Langeveld and is packaged by all major distributions. It reads its data from procfs and sysfs counters, optionally supplemented by process accounting and kernel extensions, and it shows only the activity that occurred during each sampling interval rather than cumulative totals since boot.

How atop collects and presents data

atop works in fixed sampling intervals, ten seconds by default in interactive mode. At the end of each interval it reads the kernel counters, subtracts the previous values and displays the deltas for that interval, which makes every figure on screen a rate or a share of the interval rather than an ever-growing total.

The screen has two parts. The upper part contains system-level lines, each identified by a three-letter label, and the lower part lists processes and threads with the resources they consumed. When a resource crosses a configurable threshold, the corresponding line is shown in cyan for warning and red for critical levels.

LabelResourceTypical fields
PRCProcess summarySystem and user CPU time, process count, zombies, exits
CPU and cpuTotal and per-core processorsys, user, irq, idle, wait, steal
CPLCPU loadLoad averages, context switches, interrupts
MEM and SWPMemory and swapFree, cache, buffers, slab, swap used
PAGPagingScans, stalls, swap-in, swap-out
PSIPressure stall informationShare of time tasks waited for CPU, memory, I/O
DSK and LVMDisks and logical volumesBusy percentage, reads, writes, average service time
NETNetwork layers and interfacesPackets, throughput, TCP and UDP counters
Main system-level lines in the atop display

A distinctive detail is that atop also accounts for processes that finished during the interval. With process accounting enabled, short-lived processes such as compiler invocations or cron jobs appear in angle brackets, so their CPU and disk usage is not silently lost, which is a common blind spot in tools that only sample running processes.

Interactive views and keys

atop changes its process list view with single keys, which lets an administrator pivot from a symptom to its owner quickly. The most useful views are listed below.

KeyView or actionWhen it helps
gGeneric process viewDefault overview of busy processes
mMemory detailsFinding resident and virtual memory growth
dDisk detailsLocating processes that read or write heavily
nNetwork detailsPer-process traffic when the netatop extension is loaded
sScheduling detailsRun queue delay and thread states
cFull command lineDistinguishing several instances of one program
p and uTotals per program or per userAggregating many worker processes
AAutomatic sortingOrdering by the most loaded resource
t and TNext or previous sampleStepping through a recorded log
Frequently used atop keys

The automatic sort mode is especially practical: atop decides which resource is most saturated and sorts the processes by their use of exactly that resource, so the top line usually names the likely culprit without further keystrokes.

Logging and historical replay

The logging daemon is the main reason many administrators install atop. A systemd service, typically atop.service, runs atop in the background and writes a compressed binary snapshot to a daily file such as /var/log/atop/atop_20261128, commonly every 600 seconds, with a retention of several weeks configured by the distribution.

Those files are read with atop -r followed by the file name, optionally with -b for a begin time. The display then behaves exactly like live mode, including all keys and sort orders, which makes post-incident analysis possible long after the event. The companion command atopsar produces sar-style text reports from the same logs, useful for scripts and for comparing days.

Choosing the interval is a trade-off between resolution and disk use. A ten-minute interval keeps logs small but averages away short spikes, while a one-minute interval reveals brief saturation at the cost of roughly ten times more log volume.

atop compared with other Linux monitors

atop overlaps with several neighbors in the monitoring toolbox, but its combination of full-resource coverage and persistent logs is unusual. The comparison below shows where each tool fits.

ToolScopeHistorical dataBest use
atopSystem and processes, all resourcesBuilt-in binary logsDiagnosing past and present bottlenecks
topMainly CPU and memory per processNoneQuick check on any host
htopCPU and memory with friendly interfaceNoneInteractive process management
sarSystem-level counters onlyBuilt-in daily logsLong-term trends without process detail
iotopDisk I/O per processNoneFinding a single heavy writer
GlancesBroad system overviewExport to external storesDashboards and remote viewing
atop and related monitoring tools

In practice atop combines the questions of sar and top: sar can show that disk utilization reached 100 percent at 02:40, but only atop can show which process caused it at that moment.

Limitations and interpretation pitfalls

atop is accurate only when its numbers are read in the right context, and several fields are frequently misunderstood.

  • Disk busy percentage is a poor saturation indicator on SSDs and RAID arrays, which serve many requests in parallel; average service time and PSI I/O pressure are more telling.
  • Per-process network figures require an extension such as netatop; without it only interface-level counters are available.
  • Long logging intervals hide spikes, so an incident lasting thirty seconds may barely appear in a ten-minute sample.
  • Log files grow on busy hosts with thousands of processes and must fit the retention policy.
  • In virtual machines, the steal field shows CPU time taken by the hypervisor, which no tuning inside the guest can recover.

In plain words

atop is a dashboard for a Linux computer that shows how busy its processor, memory, disks and network are, and which programs are responsible. When something is overloaded, the relevant line turns red.

Its special strength is memory of the past. It can record what the computer was doing every few minutes, much like a flight recorder, so after a slowdown an administrator can rewind and see exactly which program caused the problem.

A real-world example

An operations team supports a database server that becomes unresponsive for several minutes most nights, yet every metric looks normal by the time anyone logs in. The administrator installs atop, enables the logging service and shortens the interval to 60 seconds for a week.

After the next incident she opens the log with atop -r and a begin time of 02:30, steps forward with t and sees the MEM line turn red while the PAG line shows heavy swap-out. The memory view points to a reporting job that briefly allocates 14 GB and pushes the database cache into swap. Moving the job to a separate host ends the nightly stalls, and the team returns the logging interval to ten minutes.