The tool you wished exists actually does: iotop

You heard it here last, to use sog‘s catchphrase. Haven’t you always wanted to track down the runaway process that was sucking up all your disk I/O? Now you can, with iotop. It’s a simple Python script, not even a full-out application. iotop uses the I/O accounting in newer 2.6 kernels >=2.6.20 (check whether /proc/self/io exists to see whether you’ve got it enabled) and requires at least Python 2.5 for AF_NETLINK sockets. Here’s what it looks like (click for larger image):

iotop screenshot

It shows overall disk read and write in MB/s. Per-process, it shows disk read and write speeds as well as percentage of time spent swapping in and percentage of time spent while waiting on I/O. In other words, it rocks.

To install it on Gentoo:
emerge iotop

You might need to sync your tree because I just added it. It’s still got testing keywords, so if you’re running stable, do this:
echo =dev-lang/python-2.5* >> /etc/portage/package.keywords
echo sys-process/iotop >> /etc/portage/package.keywords

12 thoughts on “The tool you wished exists actually does: iotop

  1. I installed it to take a look, and honestly I find it pretty ugly and harder to use with the way it displays things. For example its column labels are nonobvious, and less readable because they’re sort-of-abbreviated and have no spaces, and the same goes for the lack of separation between the units and the numbers in the data.

  2. Wow, this is exactly what I’ve been wanting all this time!

    Regarding kernel options: I enabled TASKSTATS and its dependents, although probably only TASK_IO_ACCOUNTING is needed. Confusingly, the help text claims these options are experimental, even though they don’t depend on EXPERIMENTAL.

  3. @Rudd-O

    atop?? gotta give it a try for sure

    @Donnie

    thanks for the little utility
    I am really worried by the linuxdcpp client’s disk usage
    any comments on torrent / DC++ clients and disk usage by them??
    I think those small chunks really eat your disk

    ~S

  4. This post isn’t really about disk usage or layout, just activity, so I don’t really have any comments on that. I don’t really use BitTorrent for anything.

  5. I believe blktrace is good for figuring out what’s actually happening on the block device, although I have not used it myself.

  6. Completely Off Topic, but couldn’t resist to ask.

    Did you get those fonts on a terminal running on Linux or on Mac?
    How did you get those on a Linux Box?

  7. Hi Donnie,

    Amazing tool. I actually never felt the need for something like this, but now that it exists I can think of at least a handful of cases where it could be useful directly or indirectly. I imagine that the same infrastructure could be used for performance regression tests for example.

    Thanks!!!

Comments are closed.