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

Data Center Management Training & Certifications

For System Administrators looking for ways to bolster their skills or to get ahead of the competition when job hunting, data center management training...

VMware Player Bridged Network

When you install a Workstation Player, a VMware Player bridged network is automatically set up for you. However, you may run into issues connecting...

ManageEngine OpManager Plus Pricing & Review

Server management is a critical component of maintaining a healthy and efficient IT infrastructure. This requires System administrators to continuously manage physical server hardware,...

Analyzing Web Server Logs

Modern organizations track and log data for virtually all business processes, which is why web server log analysis tools are vital for effectively using...

Harnessing the Power of PowerShell Aliases

Creating aliases for PowerShell cmdlets can be a valuable tool for saving you time and headaches over remembering the names of commands. PowerShell was...

Related Stories