| 1 | |
| 2 | * /usr/src/linux/Documentation/iostats.txt |
| 3 | {{{ |
| 4 | On 2.4 you might execute "grep 'hda ' /proc/partitions". On 2.6, you have |
| 5 | a choice of "cat /sys/block/hda/stat" or "grep 'hda ' /proc/diskstats". |
| 6 | }}} |
| 7 | {{{ |
| 8 | 2.6 diskstats: |
| 9 | 3 0 hda 446216 784926 9550688 4382310 424847 312726 5922052 19310380 0 3376340 23705160 |
| 10 | |
| 11 | Field 1 -- # of reads issued |
| 12 | This is the total number of reads completed successfully. |
| 13 | Field 2 -- # of reads merged, field 6 -- # of writes merged |
| 14 | Reads and writes which are adjacent to each other may be merged for |
| 15 | efficiency. Thus two 4K reads may become one 8K read before it is |
| 16 | ultimately handed to the disk, and so it will be counted (and queued) |
| 17 | as only one I/O. This field lets you know how often this was done. |
| 18 | Field 3 -- # of sectors read |
| 19 | This is the total number of sectors read successfully. |
| 20 | Field 4 -- # of milliseconds spent reading |
| 21 | This is the total number of milliseconds spent by all reads (as |
| 22 | measured from __make_request() to end_that_request_last()). |
| 23 | Field 5 -- # of writes completed |
| 24 | This is the total number of writes completed successfully. |
| 25 | Field 7 -- # of sectors written |
| 26 | This is the total number of sectors written successfully. |
| 27 | Field 8 -- # of milliseconds spent writing |
| 28 | This is the total number of milliseconds spent by all writes (as |
| 29 | measured from __make_request() to end_that_request_last()). |
| 30 | Field 9 -- # of I/Os currently in progress |
| 31 | The only field that should go to zero. Incremented as requests are |
| 32 | given to appropriate request_queue_t and decremented as they finish. |
| 33 | Field 10 -- # of milliseconds spent doing I/Os |
| 34 | This field is increases so long as field 9 is nonzero. |
| 35 | Field 11 -- weighted # of milliseconds spent doing I/Os |
| 36 | This field is incremented at each I/O start, I/O completion, I/O |
| 37 | merge, or read of these stats by the number of I/Os in progress |
| 38 | (field 9) times the number of milliseconds spent doing I/O since the |
| 39 | last update of this field. This can provide an easy measure of both |
| 40 | I/O completion time and the backlog that may be accumulating. |
| 41 | |
| 42 | 3 1 hda1 35486 38030 38030 38030 |
| 43 | |
| 44 | Field 1 -- # of reads issued |
| 45 | This is the total number of reads issued to this partition. |
| 46 | Field 2 -- # of sectors read |
| 47 | This is the total number of sectors requested to be read from this |
| 48 | partition. |
| 49 | Field 3 -- # of writes issued |
| 50 | This is the total number of writes issued to this partition. |
| 51 | Field 4 -- # of sectors written |
| 52 | This is the total number of sectors requested to be written to |
| 53 | this partition. |
| 54 | |
| 55 | }}} |