103 lines · 4.2 KB · Text
RawDownload
===============================================Block layer statistics in /sys/block/<dev>/stat=============================================== This file documents the contents of the /sys/block/<dev>/stat file. The stat file provides several statistics about the state of blockdevice <dev>. Q.   Why are there multiple statistics in a single file?  Doesn't sysfs   normally contain a single value per file? A.   By having a single file, the kernel can guarantee that the statistics   represent a consistent snapshot of the state of the device.  If the   statistics were exported as multiple files containing one statistic   each, it would be impossible to guarantee that a set of readings   represent a single point in time. The stat file consists of a single line of text containing 17 decimalvalues separated by whitespace.  The fields are summarized in thefollowing table, and described in more detail below.  =============== ============= =================================================Name            units         description=============== ============= =================================================read I/Os       requests      number of read I/Os processedread merges     requests      number of read I/Os merged with in-queue I/Oread sectors    sectors       number of sectors readread ticks      milliseconds  total wait time for read requestswrite I/Os      requests      number of write I/Os processedwrite merges    requests      number of write I/Os merged with in-queue I/Owrite sectors   sectors       number of sectors writtenwrite ticks     milliseconds  total wait time for write requestsin_flight       requests      number of I/Os currently in flightio_ticks        milliseconds  total time this block device has been activetime_in_queue   milliseconds  total wait time for all requestsdiscard I/Os    requests      number of discard I/Os processeddiscard merges  requests      number of discard I/Os merged with in-queue I/Odiscard sectors sectors       number of sectors discardeddiscard ticks   milliseconds  total wait time for discard requestsflush I/Os      requests      number of flush I/Os processedflush ticks     milliseconds  total wait time for flush requests=============== ============= ================================================= read I/Os, write I/Os, discard I/0s=================================== These values increment when an I/O request completes. flush I/Os========== These values increment when an flush I/O request completes. Block layer combines flush requests and executes at most one at a time.This counts flush requests executed by disk. Not tracked for partitions. read merges, write merges, discard merges========================================= These values increment when an I/O request is merged with analready-queued I/O request. read sectors, write sectors, discard_sectors============================================ These values count the number of sectors read from, written to, ordiscarded from this block device.  The "sectors" in question are thestandard UNIX 512-byte sectors, not any device- or filesystem-specificblock size.  The counters are incremented when the I/O completes. read ticks, write ticks, discard ticks, flush ticks=================================================== These values count the number of milliseconds that I/O requests havewaited on this block device.  If there are multiple I/O requests waiting,these values will increase at a rate greater than 1000/second; forexample, if 60 read requests wait for an average of 30 ms, the read_ticksfield will increase by 60*30 = 1800. in_flight========= This value counts the number of I/O requests that have been issued tothe device driver but have not yet completed.  It does not include I/Orequests that are in the queue but not yet issued to the device driver. io_ticks======== This value counts the number of milliseconds during which the device hashad I/O requests queued. time_in_queue============= This value counts the number of milliseconds that I/O requests have waitedon this block device.  If there are multiple I/O requests waiting, thisvalue will increase as the product of the number of milliseconds times thenumber of requests waiting (see "read ticks" above for an example).