Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>iostat -x</code> (I used an old <a href="http://tester-higkoo.googlecode.com/svn-history/r14/trunk/Tools/iostat/iostat.c" rel="noreferrer">source code</a> to write this up before realizing it) displays information from <code>/proc/diskstats</code> (documented <a href="http://www.kernel.org/doc/Documentation/iostats.txt" rel="noreferrer">here</a>) and <code>/proc/stat</code> (for CPU times; see <a href="http://www.kernel.org/doc/man-pages/online/pages/man5/proc.5.html" rel="noreferrer">man proc(5)</a>) (and a few others, but that's not important for understanding).</p> <p>You can see the relevant snippets of code in osgx's answer, but I couldn't make sense of them in isolation, so here's an extended explanation:</p> <ul> <li><code>%util = blkio.ticks / deltams * 100%</code></li> <li><code>deltams</code> is the time elapsed since last snapshot in ms. It uses CPU stats from <code>/proc/stat</code> presumably because it gives better results than to rely on system time, but I don't know for sure. (Side note: for some reason the times are divided by <code>HZ</code>, while the <a href="http://www.kernel.org/doc/man-pages/online/pages/man5/proc.5.html" rel="noreferrer">documentation</a> states it's in <code>USER_HZ</code>, I don't understand that.)</li> <li><p><code>blkio.ticks</code> is "# of milliseconds spent doing I/Os", from <a href="http://www.kernel.org/doc/Documentation/iostats.txt" rel="noreferrer"><code>/proc/diskstats</code> docs</a>:</p> <pre><code>Field 9 -- # of I/Os currently in progress The only field that should go to zero. Incremented as requests are given to appropriate struct request_queue and decremented as they finish. Field 10 -- # of milliseconds spent doing I/Os This field increases so long as field 9 is nonzero. </code></pre> <p>i.e. my understanding is that <code>ticks</code> is the number of ticks when any I/O request (for this device) was in progress multiplied by the duration between ticks.</p></li> </ul> <p>So <code>%util = 100%</code> means that each time the kernel looked (I guess it's 1000 times per second on modern kernels, see "HZ"), an I/O request was in progress.</p> <p>Here's an excerpt from <a href="http://dom.as/2009/03/11/iostat/" rel="noreferrer">another post on iostat</a>:</p> <blockquote> <p>[%util is] how much time did the storage device have outstanding work (was busy).</p> <p>In proper RAID environments it is more like “how much time did at least one disk in RAID array have something to do”. I’m deliberately excluding any kind of cache here – if request can be served from cache, the chance is quite negligible it will show up in %util, unlike in other values.</p> <p>What this also means – the RAID subsystem can be loaded from 6.25% (one disk doing the work) to 100% (all of them busy). Thats quite a lot of insight in single value of ’100%’, isn’t it?</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload