[lug] Per process I/O statistics

David Ahern dsahern at gmail.com
Thu Jul 16 08:48:04 MDT 2009



On 07/16/2009 08:21 AM, Steve Sullivan wrote:
> Is there any way to see per-process I/O statistics?

[dsa] depends on the release. If you are running a newer release (2.6.20
or newer) look at /proc/pid/io. You want a kernel with:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2

If you are running older releases like RHEL3 and RHEL4 I wrote a tool to
generate this data. Admittedly a very simplistic hack. It works very
well for the deployments I care about, but not necessarily a solution
that works for all. It's at http://sourceforge.net/projects/fiostats/

Starting with RHEL4.7, RHEL4 has some degree of IO accounting by
process. That is not in RHEL5.3, but I suspect it will be in RHEL 5.4 (I
have not looked at the beta yet).

david


> For example, top shows %CPU.  Why not reads/second and
> writes/second?
> 
> There are buffering issues, but one could get a good
> approximation by counting the pread and pwrite system calls.
> Are these counts available anywhere?
> 
> For that matter, is it possible to count ALL types of
> system calls for a process?
> 
> I know vmstat and iostat show I/O statistics on a system wide
> basis, but I need to know the impact of individual processes.
> 
> Thanks!
> 
> Steve
> 
> 



More information about the LUG mailing list