Installing IOTop on CentOS5

Iotop is a Python program with a top like UI used to show of behalf of which process is the I/O going on. This can come in handy for administrators trying to track down a specific process that may be causing a disk I/O bottleneck.


IOTop uses features that are a part of a newer kernel build than what CentOS ships with, so you must upgrade your kernel to at least 2.6.20. The process of doing so is outside of the scope of this article; guides can be easily found through a quick search online. If you are on our VPS, this is as easy as logging into your VPS manager, selecting your current profile under Server Manager, and changing your kernel to NDCHost LATEST. If you are building your own, make sure the version you build supports I/O accounting (CONFIG_TASKSTATS, CONFIG_TASK_DELAY_ACCT, CONFIG_TASK_IO_ACCOUNTING).

This program also requires a newer Python version than CentOS 5 supplies (2.6 vs 2.4), so we'll grab those from the EPEL repo and install them:

rpm -ivh \ \

If these installed successfully, you are now ready to install IOTop.

Installing & Configuring IOTop

Let's install the RPM:

rpm -ivh

Now, CentOS will typically keep Python2.4 as your default Python, so we can tell IOTop to use Python 2.6 in two ways. One would be to relink the /usr/local/bin/python binary to /usr/local/bin/python2.6, or we can simply change the sha-bang at the beginning of the iotop script to use he 2.6 binary instead. We choose the latter so as to not break compatibility with Python2.4-exclusive scripts.

So, edit /usr/bin/iotop and change the first line so the script looks like the following:

# iotop: Display I/O usage of processes in a top like UI
# Copyright (c) 2007, 2008 Guillaume Chazarain <>, GPLv2
# See iotop --help for some help

import sys

    from iotop.ui import main
except ImportError, e:
    print e
    print 'To run an uninstalled copy of iotop,'
    print 'launch in the top directory'
    except KeyboardInterrupt:


Using iotop is fairly straightforward. All of the options are explained in detail by the manual, so give that a glance over to answer most of your questions. The interface looks and functions almost exactly like top, so if you are familiar with it's usage, iotop will be a breeze.