Can htop show disk I/O metrics per process?

The htop command-line tool can display disk I/O metrics for individual processes, but this capability requires specific system configurations and kernel support. While htop is traditionally celebrated for its real-time CPU and memory monitoring, it also features dedicated, customizable columns for tracking read and write speeds per process. This article explores how to view these metrics within htop, details the prerequisites needed for them to function, and introduces alternative command-line utilities specifically designed for dedicated storage performance tracking.

Enabling Disk I/O Columns in htop

By default, htop does not show disk input/output data in its primary interface. To view these metrics, you must manually add the relevant columns to your display via the setup menu.

  1. Launch htop in your terminal.
  2. Press F2 (or S) to enter the Setup menu.
  3. Use the arrow keys to navigate down to Columns in the “Setup” left-hand pane.
  4. Move to the Available Columns right-hand pane and scroll down until you find the I/O metrics.
  5. Select IO_READ_RATE (the speed at which the process is currently reading from disk) and press F5 to add it to your visible columns.
  6. Select IO_WRITE_RATE (the speed at which the process is currently writing to disk) and press F5 to add it.
  7. Press F10 to save your changes and return to the main monitoring screen.

System Prerequisites and Limitations

Even after adding the columns, htop might display zeros or fail to show accurate data if certain system criteria are not met. The tool relies directly on the Linux kernel’s taskstats interface to gather per-process I/O data.

Alternative Commands for Disk I/O Monitoring

If you prefer a tool tailored entirely to storage performance without adjusting configurations, several dedicated command-line utilities can complement or replace htop for disk analysis.