How to check disk I/O and identify heavy usage

Topic: Servers linux

Summary

Use iostat, iotop, and /proc/diskstats to see disk throughput and which processes are doing the most I/O. Use this when the system is slow and CPU and memory look fine, or when tuning storage or diagnosing latency.

Intent: How-to

Quick answer

  • iostat -x 2 shows all disks every 2 seconds; look at %util (saturation), r/s w/s (IOPS), rkB/s wkB/s (throughput). High %util means the device is busy; await is average wait time.
  • iotop -o shows only processes with I/O; run as root. Sort by disk read/write to find the process causing load. pidstat -d 1 5 shows per-process I/O stats.
  • Combine with vmstat 1 for context (wa = wait for I/O). If a single process dominates, throttle it or move its data to faster storage; if the whole disk is saturated, add disk or optimize workload.

Prerequisites

Steps

  1. System-wide I/O with iostat

    iostat -x 2 (install sysstat if needed). Watch %util, r/s, w/s, rkB/s, wkB/s, await. High %util and await indicate disk bottleneck; note which device (sda, nvme0n1).

  2. Per-process I/O with iotop

    sudo iotop -o to show only processes with I/O; sort by read/write. pidstat -d 1 5 for per-PID disk stats. Identify the process(es) doing the most I/O.

  3. Interpret and act

    High wa in vmstat 1 means CPU waiting on I/O. If one process dominates, consider ionice, moving data, or limiting its I/O. If the whole device is saturated, add disks, use SSD, or reduce workload.

Summary

Use iostat for device-level I/O and iotop or pidstat for per-process I/O. Use this when the system is slow and CPU/memory are not the limit, or when tuning or diagnosing storage.

Prerequisites

Steps

Step 1: System-wide I/O with iostat

iostat -x 2

Watch %util and await; identify the busy device.

Step 2: Per-process I/O with iotop

sudo iotop -o

Or pidstat -d 1 5 for per-PID stats.

Step 3: Interpret and act

High wa (vmstat) means I/O wait. Throttle or relocate the heavy process; or scale storage if the whole device is saturated.

Verification

  • You know which device is saturated and which process(es) are doing the most I/O.

Troubleshooting

iostat not found — Install sysstat (apt/dnf). iotop shows nothing — Run as root; ensure processes are doing I/O during the sample.

Next steps

Continue to