LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-15-2007, 06:09 AM   #1
kornelix
Member
 
Registered: Oct 2005
Location: Germany
Distribution: Ubuntu
Posts: 56

Rep: Reputation: 24
Question /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
 
Old 06-17-2007, 12:13 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
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.
 
Old 06-17-2007, 02:04 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,318

Rep: Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033
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 ???.
 
Old 06-17-2007, 02:23 AM   #4
kornelix
Member
 
Registered: Oct 2005
Location: Germany
Distribution: Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 24
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.
 
Old 06-17-2007, 02:31 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,318

Rep: Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033
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.
 
Old 06-17-2007, 02:39 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,318

Rep: Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033Reputation: 1033
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.
 
  


Reply

Tags
io, proc, process


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Description for /proc/<pid>/statcpu jkunder Linux - Newbie 2 04-27-2007 01:20 PM
Reading /proc/<pid>/mem magnus.therning Programming 2 07-16-2006 08:29 AM
VmSize : Regarding /proc/<pid>/status shivaligupta Programming 0 04-06-2006 04:33 AM
Process Resurrection and /proc/pid lackluster Programming 3 03-20-2006 05:17 PM
kill pid.... won't work with 'pid' variable given.. sachitha Programming 6 03-06-2006 07:48 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration