Comments on: How to find per-process I/O statistics on Linux http://www.xaprb.com/blog/2009/08/23/how-to-find-per-process-io-statistics-on-linux/ Stay curious! Thu, 02 May 2013 12:36:53 +0000 hourly 1 http://wordpress.org/?v=3.5.1 By: Chris Rizzo http://www.xaprb.com/blog/2009/08/23/how-to-find-per-process-io-statistics-on-linux/#comment-19876 Chris Rizzo Fri, 10 Feb 2012 22:29:20 +0000 http://www.xaprb.com/blog/?p=1238#comment-19876 Ahhh… I believe I’ve found the bugs in the script. The dirtied regex should be:
m/(\S+)\((\d+)\): (dirtied) inode (\d+) \(.*?\) on (\S+)/
And line 69 should be $task->{‘dirtied’}, not $task->{‘dirty’} (given the following input):
Feb 9 20:20:23 XRX_0000AA9E8ABA kernel: [ 14.974373] klogd(242): dirtied inode 47718 (klogd.pid) on sda5

]]>
By: Chris Rizzo http://www.xaprb.com/blog/2009/08/23/how-to-find-per-process-io-statistics-on-linux/#comment-19875 Chris Rizzo Fri, 10 Feb 2012 21:12:12 +0000 http://www.xaprb.com/blog/?p=1238#comment-19875 iodump appears to have a bug in it, as it always reports a 0 for “DIRTY”. Unfortunately, I am not a perl or regex expert and after spending several hours with this script cannot seem to get a valid value for DIRTY count. The reason I believe DIRTY count is important is the system I’m testing has an ext3 file system with kjournald doing reads and writes on behalf of processes. So if a process “dirty” requires a kjournald write, that won’t show up without the DIRTY value. Plus, the key measure I’m looking at right now is per process startup resource usage, and a command line linux tool such as iostat that can’t be run until well after startup has completed won’t help. Was hoping to use iodump to process the kernel log to crunch the startup data. Thanks!

]]>
By: Yong Huang http://www.xaprb.com/blog/2009/08/23/how-to-find-per-process-io-statistics-on-linux/#comment-19029 Yong Huang Mon, 03 Jan 2011 19:48:57 +0000 http://www.xaprb.com/blog/?p=1238#comment-19029 For those trying to get Guillaume Chazarain’s sophisticated iotop to work, try my humble little topio program as a workaround:
http://yong321.freeshell.org/freeware/pio.html#linux

Over the past 7 years, I ported my program to multiple OS’es. The Linux version was done only a few months ago.

]]>
By: Greg Smith http://www.xaprb.com/blog/2009/08/23/how-to-find-per-process-io-statistics-on-linux/#comment-19026 Greg Smith Mon, 03 Jan 2011 19:02:48 +0000 http://www.xaprb.com/blog/?p=1238#comment-19026 The unit for block_dump data is blocks, and the easiest way to determine that size in a way that works for any filesystem type is:

/sbin/blockdev –getbsz /dev/sda1

Note that even though I/O accounting showed up in RHEL 5.4, you still can’t get iotop to work because of other dependencies. As of iotop 0.4, it will compile and run against the Python 2.4 included with RHEL, so long as you’ve installed the python-ctypes package. But iotop still doesn’t work. Even though the main per-process I/O patch was backported in RHEL 5.4, the current kernel isn’t configured correctly for it, and there are other issues with the backport being incomplete. If you build iotop and run it, against the most recent RHEL 5.5 kernel I have here (2.6.18-194.26) it gives the error “CONFIG_TASK_DELAY_ACCT not enabled in kernel, cannot determine SWAPIN and IO %” and the detail level is accordingly low.

There is an open enhancement request to sort this out so iotop works: https://bugzilla.redhat.com/show_bug.cgi?id=557062 but it keeps missing being included in RHEL releases. It was hoped for in 5.6 but missed that deadline. The kernel patches needed are available (along with RHEL engineer packaged iotop related RPMs) are available at http://people.redhat.com/jolsa/iotop/ ; while the patches there aren’t large, it isn’t as easy as just turning on the kernel config option.

]]>
By: terrabit http://www.xaprb.com/blog/2009/08/23/how-to-find-per-process-io-statistics-on-linux/#comment-18987 terrabit Sat, 18 Dec 2010 07:41:50 +0000 http://www.xaprb.com/blog/?p=1238#comment-18987 Here is the script :

#!/bin/bash
dmesg -c
echo 1 > /proc/sys/vm/block_dump
sleep 30
go=0
while [ $go = 0 ]; do
sleep 1
clear
dmesg | perl iodump
trap “go=1″ SIGINT
done
echo 0 > /proc/sys/vm/block_dump
dmesg -c
clear
echo Caught SIGINT.

]]>