Skip to content

iotop - Per-Process Disk I/O Monitor Cheatsheet

iotop - Per-Process Disk I/O Monitor Cheatsheet

iotop is a top-like utility that displays disk I/O usage per process in real time. Where iostat tells you a device is busy, iotop tells you which process is doing the reading and writing, at what rate, and with what I/O priority. It is the fastest way to answer “what is hammering the disk right now?” It reads kernel accounting data and therefore needs root.

Installation

PlatformCommand
Debian/Ubuntusudo apt install iotop
Fedora/RHELsudo dnf install iotop
Arch Linuxsudo pacman -S iotop
RequirementKernel with CONFIG_TASK_IO_ACCOUNTING (standard)
Verifysudo iotop --version

Running

CommandDescription
sudo iotopInteractive live view of all processes
sudo iotop -oOnly show processes actually doing I/O
sudo iotop -aShow accumulated I/O (totals, not rates)
sudo iotop -PShow processes (not individual threads)
sudo iotop -u USERFilter by user
sudo iotop -d 5Refresh every 5 seconds

The Display

ColumnMeaning
TID/PIDThread or process ID
PRIOI/O scheduling priority class
USERProcess owner
DISK READCurrent read rate
DISK WRITECurrent write rate
SWAPIN% time spent swapping in
IO% time waiting on I/O
COMMANDThe process command line

Two header lines show Total and Actual disk read/write for the whole system.

Interactive Keys

KeyAction
oToggle --only (hide idle processes)
aToggle accumulated vs rate
pToggle processes/threads
rReverse the sort order
/ Change the sort column
qQuit

Batch / Logging Mode

For scripts and capturing evidence, run non-interactively.

# Log the top I/O processes every 2s, 10 iterations, only active ones
sudo iotop -boPqqq -d 2 -n 10 > iotop.log
FlagEffect
-bBatch (non-interactive) mode
-oOnly active processes
-n NNumber of iterations
-qQuiet (repeat to suppress headers)
-kKilobytes

Common Workflows

# "What is writing to disk right now?" — only active, processes not threads
sudo iotop -oP

# Catch a periodic I/O spike over time
sudo iotop -boP -d 1 -n 60 > spikes.log

# Blame a user's processes for disk load
sudo iotop -oP -u appuser

I/O Priority (pairs with ionice)

iotop shows the PRIO (ionice) class; you change it with ionice.

ionice classMeaning
ionice -c 1Realtime I/O priority
ionice -c 2 -n 0..7Best-effort (default), level 0 = highest
ionice -c 3Idle — only I/O when disk is otherwise free
# Deprioritize a heavy batch job's disk I/O
ionice -c 3 -p $(pgrep -n backup)
ToolAnswers
iotopWhich process is doing disk I/O
iostatWhether the device is saturated
pidstat -dPer-process I/O (scriptable, sysstat)
dstat/doolCombined system view

Workflow: iostat shows the disk is busy → iotop shows which process → ionice deprioritizes it.

Resources