How to Install and Use iotop on Linux Hosts

Introduction

When a Linux server experiences slow performance, high disk latency, or unexpected storage bottlenecks, identifying the process responsible for excessive disk I/O becomes critical. While tools such as top and htop help monitor CPU and memory usage, they do not provide detailed visibility into disk input/output activity.

iotop is a powerful command-line utility that displays real-time disk I/O usage by processes and users, making it easier for system administrators to troubleshoot performance issues, identify resource-intensive applications, and monitor storage activity.

This guide explains how to install and use iotop on Ubuntu, Debian, CentOS, RHEL, and other Linux distributions.


What is iotop?

iotop is an interactive monitoring tool that shows:

  • Real-time disk read/write activity
  • Processes generating the most I/O
  • Per-user disk utilization
  • Total disk bandwidth consumption
  • Accumulated I/O statistics

The tool works similarly to the top command but focuses specifically on disk I/O operations.

Key Benefits

  • Quickly identify disk-intensive processes
  • Troubleshoot slow server performance
  • Monitor database and application workloads
  • Detect backup jobs or rogue processes consuming storage resources
  • Analyze disk bottlenecks in real time

Prerequisites

Before installing iotop, ensure:

  • Root or sudo privileges are available.
  • The Linux kernel supports task I/O accounting (enabled by default on most modern distributions).

Installing iotop

Ubuntu / Debian

Update the package repository and install iotop:

sudo apt update
sudo apt install iotop -y

Verify the installation:

iotop --version

CentOS 7 / RHEL 7

Install using YUM:

sudo yum install iotop -y

CentOS Stream / Rocky Linux / AlmaLinux / RHEL 8+

Install using DNF:

sudo dnf install iotop -y

Verify installation:

iotop --version

Running iotop

Launch iotop with root privileges:

sudo iotop

You will see a real-time display showing:

  • Process ID (PID)
  • User
  • Disk read rate
  • Disk write rate
  • Swap usage
  • I/O percentage
  • Command executed

Example:

PID  USER      DISK READ  DISK WRITE  COMMAND
2451 mysql     10.25 M/s  1.50 M/s    mysqld
3204 root      5.00 M/s   2.30 M/s    rsync

Useful iotop Commands

Display Only Active I/O Processes

Show only processes currently performing disk operations:

sudo iotop -o

Monitor Specific User Activity

Filter activity by user:

sudo iotop -u mysql

Replace mysql with the required username.


Batch Mode Output

Generate output suitable for scripts and logging:

sudo iotop -b

Capture Limited Iterations

Display 10 updates and exit:

sudo iotop -b -n 10

Display Accumulated I/O Statistics

Show total I/O usage since process start:

sudo iotop -a

Sort Processes by I/O Usage

Run:

sudo iotop

Then use interactive keys:

  • r – Sort by read activity
  • w – Sort by write activity
  • o – Toggle active I/O processes only
  • a – Toggle accumulated I/O mode
  • q – Quit

Troubleshooting

If you receive an error similar to:

Netlink error: No such file or directory

Ensure task I/O accounting is enabled:

cat /proc/sys/kernel/task_delayacct

If the output is 0, enable it:

sudo sysctl kernel.task_delayacct=1

To make the setting persistent:

echo "kernel.task_delayacct=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

Alternative Tools

If iotop is unavailable, consider these alternatives:

Tool Purpose
iostat Disk utilization statistics
dstat System resource monitoring
atop Advanced system monitoring
sar Historical performance analysis
pidstat Per-process resource statistics

Conclusion

iotop is an essential monitoring tool for Linux administrators and DevOps engineers who need visibility into disk I/O activity. It provides real-time insights into which processes and users are consuming storage resources, helping quickly identify performance bottlenecks and troubleshoot system slowdowns.

Whether you’re managing application servers, database hosts, or storage-intensive workloads, iotop offers a simple and effective way to monitor disk usage and maintain optimal system performance.

For detailed command options and advanced usage, refer to the manual page:

man iotop

Frequently Asked Questions (FAQ)

1. What is iotop used for?

iotop is a Linux monitoring utility that displays real-time disk I/O usage by processes and users. It helps administrators identify applications or services causing high disk read/write activity.


2. Is iotop installed by default on Linux?

No. Most Linux distributions do not include iotop by default. It must be installed manually using the package manager (apt, yum, or dnf).


3. Do I need root privileges to run iotop?

Yes. Root or sudo privileges are typically required because iotop needs access to kernel-level I/O statistics.

sudo iotop

  1. SSL/TLS Configuration and Verification on Linux
  2. How the Linux Kernel Handles Network Connections Using DNS and Routing
  3. How to Install Plesk on a Linux Server

Talk to our experts

Looking for the right technology solution for your business? Our team of experts can help you with development, cloud, DevOps, design, and a wide range of other technology needs. Get in touch with our team here.


admin

Writes about Web & Architecture at Pheonix Solutions.

Leave a Reply

Scroll to Top