SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
Click here to see the post LQ members have rated as the most helpful post in this thread.
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
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:
First off, I apologize for replying to an old thread, but I thought that someone might find this useful:
Date: February 2008
Contact: Jerome Marchand <email@example.com>
The /proc/diskstats file displays the I/O statistics
of block devices. Each line contains the following 14
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