Guides Monitoring Disk Usage With Iotop

Monitoring Disk Usage With Iotop

If you want to keep an eye on the CPU usage of your processes, you can use top. For disk I/O, the Python program iotop does the same thing, which can be extremely useful if you’re experiencing hard disk thrashing.

Tip of the Trade: Hard disk thrashing? Check out Iotop, a Python program similar to top that enables you to keep an eye on disk I/O.

iotop is available as a package for Debian and Ubuntu, and it should work out-of-the-box if you’re running a standard kernel. If you’re installing from source, you’ll need Python 2.5 or later and a 2.6.20 or later kernel with the TASK_DELAY_ACCT and TASK_IO_ACCOUNTING options enabled.

The basic output is easy to read; it looks a lot like top. For each process, it shows disk read, disk write, percentage of time spent while swapping, percentage of time spent swap space used and percentage of time spent waiting on I/O. You can use the left and right arrows to change which column the display sorts on and hit “r” to reverse the sort order for that column.

By default, all processes are shown, but you can use iotop --only, or hit o during the display, to show only processes or threads actively doing I/O. You can also limit it to processes (rather than including all threads) with the -P command-line option. Finally, for non-interactive I/O monitoring, use iotop --batch -n 5 to run five iterations and output to iotop.out.

If for some reason you can’t use iotop, you can use vmstat 1 instead and look at the bi and bo columns. This, however, is far less human-readable, and it doesn’t include dynamic reordering options. It’s well worth having iotop available on your systems.

Juliet Kemp has been messing around with Linux systems, for financial reward and otherwise, for about a decade. She is also the author of “Linux System Administration Recipes: A Problem-Solution Approach” (Apress, 2009).

Follow ServerWatch on Twitter

Latest Posts

Proxmox vs VMware Comparison

Proxmox virtual machines (VM) are highly popular with home server aficionados, whereas VMware sits squarely at the front of the enterprise VM market. Both...

What is Load Balancing?

Load balancing is a technique that ensures an organization's server does not get overloaded with traffic. With load balancing measures in place, workloads and...

Installing and Activating Hyper-V Linux Integration Services

Editor's Note: Updated to reflect changes with the Hyper-V Linux Integration Services 4.3 release. Microsoft developers have designed components that help in improving the performance of...

What is a Hypervisor Server?

At its most basic, a hypervisor is the “manager” of a software-hardware stack. The term “hypervisor” derives from the word “supervisor.” What is a Hypervisor? When...

HPE SimpliVity 380 Server Review

The HPE SimpliVity 380 Server was designed to deliver the high performance required by enterprise data centers in a simplified package. One of the...

Related Stories