sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget'/translations/zh_CN/admin-guide/iostatsmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget'/translations/zh_TW/admin-guide/iostatsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget'/translations/it_IT/admin-guide/iostatsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget'/translations/ja_JP/admin-guide/iostatsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget'/translations/ko_KR/admin-guide/iostatsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget'/translations/sp_SP/admin-guide/iostatsmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hI/O statistics fieldsh]hI/O statistics fields}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhA/var/lib/git/docbuild/linux/Documentation/admin-guide/iostats.rsthKubh paragraph)}(hThe kernel exposes disk statistics via ``/proc/diskstats`` and ``/sys/block//stat``. These stats are usually accessed via tools such as ``sar`` and ``iostat``.h](h'The kernel exposes disk statistics via }(hhhhhNhNubhliteral)}(h``/proc/diskstats``h]h/proc/diskstats}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh and }(hhhhhNhNubh)}(h``/sys/block//stat``h]h/sys/block//stat}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh5. These stats are usually accessed via tools such as }(hhhhhNhNubh)}(h``sar``h]hsar}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh and }(hhhhhNhNubh)}(h ``iostat``h]hiostat}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h4Here are examples using a disk with two partitions::h]h3Here are examples using a disk with two partitions:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh literal_block)}(hX/proc/diskstats: 259 0 nvme0n1 255999 814 12369153 47919 996852 81 36123024 425995 0 301795 580470 0 0 0 0 60602 106555 259 1 nvme0n1p1 492 813 17572 96 848 81 108288 210 0 76 307 0 0 0 0 0 0 259 2 nvme0n1p2 255401 1 12343477 47799 996004 0 36014736 425784 0 344336 473584 0 0 0 0 0 0 /sys/block/nvme0n1/stat: 255999 814 12369153 47919 996858 81 36123056 426009 0 301809 580491 0 0 0 0 60605 106562 /sys/block/nvme0n1/nvme0n1p1/stat: 492 813 17572 96 848 81 108288 210 0 76 307 0 0 0 0 0 0h]hX/proc/diskstats: 259 0 nvme0n1 255999 814 12369153 47919 996852 81 36123024 425995 0 301795 580470 0 0 0 0 60602 106555 259 1 nvme0n1p1 492 813 17572 96 848 81 108288 210 0 76 307 0 0 0 0 0 0 259 2 nvme0n1p2 255401 1 12343477 47799 996004 0 36014736 425784 0 344336 473584 0 0 0 0 0 0 /sys/block/nvme0n1/stat: 255999 814 12369153 47919 996858 81 36123056 426009 0 301809 580491 0 0 0 0 60605 106562 /sys/block/nvme0n1/nvme0n1p1/stat: 492 813 17572 96 848 81 108288 210 0 76 307 0 0 0 0 0 0}hj!sbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhK hhhhubh)}(hX-Both files contain the same 17 statistics. ``/sys/block//stat`` contains the fields for ````. In ``/proc/diskstats`` the fields are prefixed with the major and minor device numbers and the device name. In the example above, the first stat value for ``nvme0n1`` is 255999 in both files.h](h+Both files contain the same 17 statistics. }(hj1hhhNhNubh)}(h``/sys/block//stat``h]h/sys/block//stat}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1ubh contains the fields for }(hj1hhhNhNubh)}(h ````h]h}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1ubh. In }(hj1hhhNhNubh)}(h``/proc/diskstats``h]h/proc/diskstats}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1ubh the fields are prefixed with the major and minor device numbers and the device name. In the example above, the first stat value for }(hj1hhhNhNubh)}(h ``nvme0n1``h]hnvme0n1}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1ubh is 255999 in both files.}(hj1hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXThe sysfs ``stat`` file is efficient for monitoring a small, known set of disks. If you're tracking a large number of devices, ``/proc/diskstats`` is often the better choice since it avoids the overhead of opening and closing multiple files for each snapshot.h](h The sysfs }(hjhhhNhNubh)}(h``stat``h]hstat}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubho file is efficient for monitoring a small, known set of disks. If you’re tracking a large number of devices, }(hjhhhNhNubh)}(h``/proc/diskstats``h]h/proc/diskstats}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhq is often the better choice since it avoids the overhead of opening and closing multiple files for each snapshot.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXFAll fields are cumulative, monotonic counters, except for field 9, which resets to zero as I/Os complete. The remaining fields reset at boot, on device reattachment or reinitialization, or when the underlying counter overflows. Applications reading these counters should detect and handle resets when comparing stat snapshots.h]hXFAll fields are cumulative, monotonic counters, except for field 9, which resets to zero as I/Os complete. The remaining fields reset at boot, on device reattachment or reinitialization, or when the underlying counter overflows. Applications reading these counters should detect and handle resets when comparing stat snapshots.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hhhhubh)}(hEach set of stats only applies to the indicated device; if you want system-wide stats you'll have to find all the devices and sum them all up.h]hEach set of stats only applies to the indicated device; if you want system-wide stats you’ll have to find all the devices and sum them all up.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hhhhubhdefinition_list)}(hhh](hdefinition_list_item)}(hkField 1 -- # of reads completed (unsigned long) This is the total number of reads completed successfully. h](hterm)}(h0Field 1 -- # of reads completed (unsigned long)h]h0Field 1 -- # of reads completed (unsigned long)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK+hjubh definition)}(hhh]h)}(h9This is the total number of reads completed successfully.h]h9This is the total number of reads completed successfully.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK+hjubj)}(hX^Field 2 -- # of reads merged, field 6 -- # of writes merged (unsigned long) Reads and writes which are adjacent to each other may be merged for efficiency. Thus two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done. h](j)}(hLField 2 -- # of reads merged, field 6 -- # of writes merged (unsigned long)h]hLField 2 -- # of reads merged, field 6 -- # of writes merged (unsigned long)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK1hjubj)}(hhh]h)}(hXReads and writes which are adjacent to each other may be merged for efficiency. Thus two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done.h]hXReads and writes which are adjacent to each other may be merged for efficiency. Thus two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done.}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hj!ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK1hjhhubj)}(heField 3 -- # of sectors read (unsigned long) This is the total number of sectors read successfully. h](j)}(h-Field 3 -- # of sectors read (unsigned long)h]h-Field 3 -- # of sectors read (unsigned long)}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK4hj>ubj)}(hhh]h)}(h6This is the total number of sectors read successfully.h]h6This is the total number of sectors read successfully.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjPubah}(h]h ]h"]h$]h&]uh1jhj>ubeh}(h]h ]h"]h$]h&]uh1jhhhK4hjhhubj)}(hField 4 -- # of milliseconds spent reading (unsigned int) This is the total number of milliseconds spent by all reads (as measured from blk_mq_alloc_request() to __blk_mq_end_request()). h](j)}(h:Field 4 -- # of milliseconds spent reading (unsigned int)h]h:Field 4 -- # of milliseconds spent reading (unsigned int)}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK8hjmubj)}(hhh]h)}(hThis is the total number of milliseconds spent by all reads (as measured from blk_mq_alloc_request() to __blk_mq_end_request()).h]hThis is the total number of milliseconds spent by all reads (as measured from blk_mq_alloc_request() to __blk_mq_end_request()).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hjubah}(h]h ]h"]h$]h&]uh1jhjmubeh}(h]h ]h"]h$]h&]uh1jhhhK8hjhhubj)}(hmField 5 -- # of writes completed (unsigned long) This is the total number of writes completed successfully. h](j)}(h1Field 5 -- # of writes completed (unsigned long)h]h1Field 5 -- # of writes completed (unsigned long)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK;hjubj)}(hhh]h)}(h:This is the total number of writes completed successfully.h]h:This is the total number of writes completed successfully.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK;hjhhubj)}(hPField 6 -- # of writes merged (unsigned long) See the description of field 2. h](j)}(h/Field 6 -- # of writes merged (unsigned long)h]h/Field 6 -- # of writes merged (unsigned long)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK>hjubj)}(hhh]h)}(hSee the description of field 2.h]hSee the description of field 2.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK>hjhhubj)}(hkField 7 -- # of sectors written (unsigned long) This is the total number of sectors written successfully. h](j)}(h0Field 7 -- # of sectors written (unsigned long)h]h0Field 7 -- # of sectors written (unsigned long)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKAhjubj)}(hhh]h)}(h9This is the total number of sectors written successfully.h]h9This is the total number of sectors written successfully.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKAhjhhubj)}(hField 8 -- # of milliseconds spent writing (unsigned int) This is the total number of milliseconds spent by all writes (as measured from blk_mq_alloc_request() to __blk_mq_end_request()). h](j)}(h:Field 8 -- # of milliseconds spent writing (unsigned int)h]h:Field 8 -- # of milliseconds spent writing (unsigned int)}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKEhj)ubj)}(hhh]h)}(hThis is the total number of milliseconds spent by all writes (as measured from blk_mq_alloc_request() to __blk_mq_end_request()).h]hThis is the total number of milliseconds spent by all writes (as measured from blk_mq_alloc_request() to __blk_mq_end_request()).}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhj;ubah}(h]h ]h"]h$]h&]uh1jhj)ubeh}(h]h ]h"]h$]h&]uh1jhhhKEhjhhubj)}(hField 9 -- # of I/Os currently in progress (unsigned int) The only field that should go to zero. Incremented as requests are given to appropriate struct request_queue and decremented as they finish. h](j)}(h:Field 9 -- # of I/Os currently in progress (unsigned int)h]h:Field 9 -- # of I/Os currently in progress (unsigned int)}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKIhjXubj)}(hhh]h)}(hThe only field that should go to zero. Incremented as requests are given to appropriate struct request_queue and decremented as they finish.h]hThe only field that should go to zero. Incremented as requests are given to appropriate struct request_queue and decremented as they finish.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhjjubah}(h]h ]h"]h$]h&]uh1jhjXubeh}(h]h ]h"]h$]h&]uh1jhhhKIhjhhubj)}(hX9Field 10 -- # of milliseconds spent doing I/Os (unsigned int) This field increases so long as field 9 is nonzero. Since 5.0 this field counts jiffies when at least one request was started or completed. If request runs more than 2 jiffies then some I/O time might be not accounted in case of concurrent requests. h](j)}(h=Field 10 -- # of milliseconds spent doing I/Os (unsigned int)h]h=Field 10 -- # of milliseconds spent doing I/Os (unsigned int)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKPhjubj)}(hhh](h)}(h3This field increases so long as field 9 is nonzero.h]h3This field increases so long as field 9 is nonzero.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjubh)}(hSince 5.0 this field counts jiffies when at least one request was started or completed. If request runs more than 2 jiffies then some I/O time might be not accounted in case of concurrent requests.h]hSince 5.0 this field counts jiffies when at least one request was started or completed. If request runs more than 2 jiffies then some I/O time might be not accounted in case of concurrent requests.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKPhjhhubj)}(hXField 11 -- weighted # of milliseconds spent doing I/Os (unsigned int) This field is incremented at each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/Os in progress (field 9) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an easy measure of both I/O completion time and the backlog that may be accumulating. h](j)}(hFField 11 -- weighted # of milliseconds spent doing I/Os (unsigned int)h]hFField 11 -- weighted # of milliseconds spent doing I/Os (unsigned int)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKWhjubj)}(hhh]h)}(hXHThis field is incremented at each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/Os in progress (field 9) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an easy measure of both I/O completion time and the backlog that may be accumulating.h]hXHThis field is incremented at each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/Os in progress (field 9) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an easy measure of both I/O completion time and the backlog that may be accumulating.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKShjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKWhjhhubj)}(hqField 12 -- # of discards completed (unsigned long) This is the total number of discards completed successfully. h](j)}(h3Field 12 -- # of discards completed (unsigned long)h]h3Field 12 -- # of discards completed (unsigned long)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKZhjubj)}(hhh]h)}(hu nametypes}(jIjrjAuh}(jFhjojKj>juu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.