104 lines · plain
1===============================================2Block layer statistics in /sys/block/<dev>/stat3===============================================4 5This file documents the contents of the /sys/block/<dev>/stat file.6 7The stat file provides several statistics about the state of block8device <dev>.9 10Q.11 Why are there multiple statistics in a single file? Doesn't sysfs12 normally contain a single value per file?13 14A.15 By having a single file, the kernel can guarantee that the statistics16 represent a consistent snapshot of the state of the device. If the17 statistics were exported as multiple files containing one statistic18 each, it would be impossible to guarantee that a set of readings19 represent a single point in time.20 21The stat file consists of a single line of text containing 17 decimal22values separated by whitespace. The fields are summarized in the23following table, and described in more detail below.24 25 26=============== ============= =================================================27Name units description28=============== ============= =================================================29read I/Os requests number of read I/Os processed30read merges requests number of read I/Os merged with in-queue I/O31read sectors sectors number of sectors read32read ticks milliseconds total wait time for read requests33write I/Os requests number of write I/Os processed34write merges requests number of write I/Os merged with in-queue I/O35write sectors sectors number of sectors written36write ticks milliseconds total wait time for write requests37in_flight requests number of I/Os currently in flight38io_ticks milliseconds total time this block device has been active39time_in_queue milliseconds total wait time for all requests40discard I/Os requests number of discard I/Os processed41discard merges requests number of discard I/Os merged with in-queue I/O42discard sectors sectors number of sectors discarded43discard ticks milliseconds total wait time for discard requests44flush I/Os requests number of flush I/Os processed45flush ticks milliseconds total wait time for flush requests46=============== ============= =================================================47 48read I/Os, write I/Os, discard I/0s49===================================50 51These values increment when an I/O request completes.52 53flush I/Os54==========55 56These values increment when an flush I/O request completes.57 58Block layer combines flush requests and executes at most one at a time.59This counts flush requests executed by disk. Not tracked for partitions.60 61read merges, write merges, discard merges62=========================================63 64These values increment when an I/O request is merged with an65already-queued I/O request.66 67read sectors, write sectors, discard_sectors68============================================69 70These values count the number of sectors read from, written to, or71discarded from this block device. The "sectors" in question are the72standard UNIX 512-byte sectors, not any device- or filesystem-specific73block size. The counters are incremented when the I/O completes.74 75read ticks, write ticks, discard ticks, flush ticks76===================================================77 78These values count the number of milliseconds that I/O requests have79waited on this block device. If there are multiple I/O requests waiting,80these values will increase at a rate greater than 1000/second; for81example, if 60 read requests wait for an average of 30 ms, the read_ticks82field will increase by 60*30 = 1800.83 84in_flight85=========86 87This value counts the number of I/O requests that have been issued to88the device driver but have not yet completed. It does not include I/O89requests that are in the queue but not yet issued to the device driver.90 91io_ticks92========93 94This value counts the number of milliseconds during which the device has95had I/O requests queued.96 97time_in_queue98=============99 100This value counts the number of milliseconds that I/O requests have waited101on this block device. If there are multiple I/O requests waiting, this102value will increase as the product of the number of milliseconds times the103number of requests waiting (see "read ticks" above for an example).104