LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   /proc/pid/io seems not to work (http://www.linuxquestions.org/questions/linux-server-73/proc-pid-io-seems-not-to-work-562003/)

kornelix 06-15-2007 07:09 AM

/proc/pid/io seems not to work
 
I tried out the new process I/O statistics in kernels after 2.6.20 and I got some meaningless data.

According to the meager docs I have found, you should be able to get I/O statistics per process (counts and bytes for reads and writes) with something as simple as

$ cat /proc/<pid>/io

Indeed some numbers come out, but the disk bytes read and written are coming up zero for processes having hundreds of disk I/O's done in the normal manner: open(), read(), etc.

I am using fedora 7 with kernel 2.6.21

Must I do something else, such as enable this feature in some obscure way?

Man page for proc has not been updated for /io data.

thanks

macemoneta 06-17-2007 01:13 AM

There's some documentation here in the patch that added it. From the documentation, if the i/O never touched the storage layer (it was satisfied by a cache hit), the count will not increment.

syg00 06-17-2007 03:04 AM

I happen to like comments in the patchsets, but I can see where it doesn't suit everybody.
A bit of a problem for those on binary distros - no access to the source tree, and the manpages are always behind (the maintainers are always asking for people to help with manpages).
LXR is an option, but how many people know to go looking there ???.

kornelix 06-17-2007 03:23 AM

Thanks for the responses. Still no info about how to activate the IO counters, if such is needed. To repeat, I get zeros for disk IO counters. TTY IO (X-term window) does register some bytes.

Re: wanting outside help for man pages:

Programmers should update the documentation for anything they create or change. They are the ones with the first-hand knowledge. Waiting for someone else to do it is irresponsible, creates additional work, and introduces errors. This is the main reason Linux technical documentation is such a shambles.

Sorry for the preaching. I get upset when others make my life harder becuase they expect me to do their jobs, or climb over their obstacles.
Programmers who are "too important, too busy" to do documentation should find some other line of work.

syg00 06-17-2007 03:31 AM

As macemoneta said, how do you know you're actually doing any (physical) I/O ???.
Maybe do a sync - or set swappiness to zero for a while to minimize disk cache usage.

syg00 06-17-2007 03:39 AM

Quote:

Originally Posted by kornelix
I get upset when others make my life harder becuase they expect me to do their jobs, or climb over their obstacles.
Programmers who are "too important, too busy" to do documentation should find some other line of work.

You are getting the benefit of the efforts of others - for *FREE*.
It is (generally) not their "line of work".
If you are unhappy , go hire a tech writer to do the documentation you demand.
Then donate it to the community.


All times are GMT -5. The time now is 10:31 AM.