[Gllug] Identifying what processes are waiting on IO

Daniel P. Berrange dan at berrange.com
Sun Dec 7 13:22:09 UTC 2008


On Sun, Dec 07, 2008 at 11:09:46AM +0000, Stephen Nelson-Smith wrote:
> I would like to be able to find out what processes are using the disks, 
> and waiting on IO - so I can consider either moving them to other 
> machines, or consider reconfiguring storage in a way that is better 
> suited to the application profile.
> 
> I'm using CentOS 5, so I don't have a kernel with IO accounting, nor do 
> I have Python 2.5 or 2.6, so I can't use iotop.
> 
> I've heard good things about systemtap, but I wouldn't know where to start.

Fortunately someone else has done all the hard work for you :-) Go to the 
systemtap wiki & download the 'disktop.stp' script:

http://sourceware.org/systemtap/wiki/ScriptsTools?action=AttachFile&do=view&target=disktop.stp

You'll need to have kernel-debuginfo & kernel-devel RPMs install (or for
a Xen host/guest, kernel-xen-debuginfo & kernel-xen-devel ). Make sure
the version matches what you're running. Finally install 'systemtap'

Then as root you can run:

# stap disktop.stp

Sun Dec  7 13:10:37 2008 , Average:  38Kb/sec, Read:     192Kb, Write:      0Kb

     UID      PID     PPID                       CMD   DEVICE    T        BYTES
       0     8977     3385                      sshd     dm-0    R       197069
       0     3253        1                    auditd     dm-0    W          231

Sun Dec  7 13:10:42 2008 , Average: 331Kb/sec, Read:    1652Kb, Write:      3Kb

     UID      PID     PPID                       CMD   DEVICE    T        BYTES
       0     8979     8977                      bash     dm-0    R      1549607
       0     8977     3385                      sshd     dm-0    R        34485
       0     8979     8977                      sshd     dm-0    R        15245
       0     8988     8987                        id     dm-0    R         8449
       0     8980     8979                     xauth     dm-0    R         7428
       0     3014        1               restorecond     dm-0    R         6528
       0     8982     8979                     egrep     dm-0    R         4528
       0     8984     8979                     egrep     dm-0    R         4528
       0     8986     8979                     egrep     dm-0    R         4528
       0     8995     8979                      grep     dm-0    R         4528



This is running on my x86_64  RHEL-5.2 Xen dom0 host, so it should work
fine for you on CentOS 5 too.


If this info isn't quite what you need, then  browse through other 
examples on the wiki

http://sourceware.org/systemtap/wiki/ScriptsTools
http://sourceware.org/systemtap/wiki/WarStories

Regards,
Daniel
-- 
|: http://berrange.com/     -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://freshmeat.net/~danielpb/    -o-   http://gtk-vnc.sourceforge.net :|
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list