LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 09-05-2005, 06:30 AM   #1
rajesht
LQ Newbie
 
Registered: May 2005
Posts: 7

Rep: Reputation: 0
Interpreting /proc/diskstats


HI,
I need to interpret the entries in the file "/proc/diskstats". I searched and found about the first three fields. The first three fields are "Major Device Number", "minor Device Number" and "Device Name". Could anyone help me interpret the rest of the fields.


Thanks.

Rajesh.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 09-06-2005, 10:48 PM   #2
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
Take a look at Documentation/iostats.txt in a kernel source tree.
 
Old 09-08-2005, 06:21 AM   #3
rajesht
LQ Newbie
 
Registered: May 2005
Posts: 7

Original Poster
Rep: Reputation: 0
I have searched throughout my box and was not able to find the file "iostat.txt". could you please help me.
 
Old 09-08-2005, 09:27 AM   #4
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
It's iostats.txt, plural. And it's in the kernel source tree, if you haven't installed any kernel-source packages or downloaded the source from kernel.org you probably won't have one.
 
Old 07-15-2009, 01:03 AM   #5
cbellamk
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 2
Field 1 -- # of reads issued
Field 2 -- # of reads merged, field 6 -- # of writes merged
Field 3 -- # of sectors read
Field 4 -- # of milliseconds spent reading
Field 5 -- # of writes completed
Field 7 -- # of sectors written
Field 8 -- # of milliseconds spent writing
Field 9 -- # of I/Os currently in progress
Field 10 -- # of milliseconds spent doing I/Os
Field 11 -- weighted # of milliseconds spent doing I/Os


#cat /proc/diskstats | grep hda

3 0 hda 43205 4113 4800428 280967 1051597 1682874 21876608 1950120 0 858685 2231096
3 1 hda1 25838 525266 1505217 12041736
3 2 hda2 846 1164 88 704
3 3 hda3 20498 4272886 1229274 9834168

Let`s consider "How I can get stats for my /dev/hda3 ??"
Let`s consider this line : 3 3 hda3 20498 4272886 1229274 9834168
After a word "hda3" we have four 32-bit (type integer) fields, us interesting these:
The second field: 4272886 (total number of sectors which normally reads from /dev/hda3)
and The Fourth filed : 9834168 (total number of sectors which normally writes to /dev/hda3)
These two fields - all that is necessary for us. A /proc/diskstats continuously updated and all that is necessary for us - make measurements for "second field" and "fourth field" in two different moment of time, receiving a difference of values and dividing it into an interval of time, we shall have Disk I/O stats in sectors/sec. Multiply this result on 512 (number of bytes in one sector) we shall have Disk I/O stats in bytes/sec.
May be exist a problem how to measure precisely moment of a time in seconds ...
Here a piece of my code on С for this purpose:
 
2 members found this post helpful.
Old 12-30-2013, 12:34 PM   #6
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 179

Rep: Reputation: 24
First off, I apologize for replying to an old thread, but I thought that someone might find this useful:
Quote:
What: /proc/diskstats
Date: February 2008
Contact: Jerome Marchand <jmarchan@redhat.com>
Description:
The /proc/diskstats file displays the I/O statistics
of block devices. Each line contains the following 14
fields:
1 - major number
2 - minor mumber
3 - device name
4 - reads completed successfully
5 - reads merged
6 - sectors read
7 - time spent reading (ms)
8 - writes completed
9 - writes merged
10 - sectors written
11 - time spent writing (ms)
12 - I/Os currently in progress
13 - time spent doing I/Os (ms)
14 - weighted time spent doing I/Os (ms)
For more details refer to Documentation/iostats.txt
Source: https://www.kernel.org/doc/Documenta...ocfs-diskstats
 
2 members found this post helpful.
Old 02-23-2014, 04:58 AM   #7
larchicha
LQ Newbie
 
Registered: Feb 2014
Posts: 2

Rep: Reputation: Disabled
Thank you gacanepa !
You've been of great help... you're the first one i found explaining the true meaning of all these numbers... (after a good 15min google search )

I wish there was a like button, you made my day.
 
Old 02-23-2014, 05:37 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,793

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
There is - 2 actually.
Click the "Yes" after "Did you find this post useful?", or if you want to leave a comment, click the "rep" link under the userid on the left.

Oh, and welcome ...
 
1 members found this post helpful.
Old 02-25-2014, 02:10 PM   #9
larchicha
LQ Newbie
 
Registered: Feb 2014
Posts: 2

Rep: Reputation: Disabled
Smile

Didn't see that... Thank you.

And Thanks again for the welcome, i always end myself on this website after searching,
without ever posting or thanking... what a rude person i am
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Correlation between /proc/devices and /proc/modules ColinLadyka Linux - General 1 02-13-2006 05:25 PM
interpreting system messages corbis_demon Linux - Newbie 1 10-29-2004 12:54 PM
interpreting a cron nitaish Linux - General 1 10-15-2004 12:18 PM
interpreting gdb...... deadhead Programming 2 12-03-2003 10:12 PM
Interpreting mail sent by logwatch JasonW Linux - General 0 02-20-2003 06:17 PM


All times are GMT -5. The time now is 08:04 PM.

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