Commit | Line | Data |
---|---|---|
898bd37a | 1 | =============================================== |
37a32795 AI |
2 | Block layer statistics in /sys/block/<dev>/stat |
3 | =============================================== | |
4 | ||
5 | This file documents the contents of the /sys/block/<dev>/stat file. | |
6 | ||
7 | The stat file provides several statistics about the state of block | |
8 | device <dev>. | |
9 | ||
898bd37a MCC |
10 | Q. |
11 | Why are there multiple statistics in a single file? Doesn't sysfs | |
37a32795 | 12 | normally contain a single value per file? |
898bd37a MCC |
13 | |
14 | A. | |
15 | By having a single file, the kernel can guarantee that the statistics | |
37a32795 AI |
16 | represent a consistent snapshot of the state of the device. If the |
17 | statistics were exported as multiple files containing one statistic | |
18 | each, it would be impossible to guarantee that a set of readings | |
19 | represent a single point in time. | |
20 | ||
21 | The stat file consists of a single line of text containing 11 decimal | |
22 | values separated by whitespace. The fields are summarized in the | |
23 | following table, and described in more detail below. | |
24 | ||
898bd37a MCC |
25 | |
26 | =============== ============= ================================================= | |
37a32795 | 27 | Name units description |
898bd37a | 28 | =============== ============= ================================================= |
37a32795 AI |
29 | read I/Os requests number of read I/Os processed |
30 | read merges requests number of read I/Os merged with in-queue I/O | |
31 | read sectors sectors number of sectors read | |
32 | read ticks milliseconds total wait time for read requests | |
33 | write I/Os requests number of write I/Os processed | |
34 | write merges requests number of write I/Os merged with in-queue I/O | |
35 | write sectors sectors number of sectors written | |
36 | write ticks milliseconds total wait time for write requests | |
37 | in_flight requests number of I/Os currently in flight | |
38 | io_ticks milliseconds total time this block device has been active | |
39 | time_in_queue milliseconds total wait time for all requests | |
bdca3c87 MC |
40 | discard I/Os requests number of discard I/Os processed |
41 | discard merges requests number of discard I/Os merged with in-queue I/O | |
42 | discard sectors sectors number of sectors discarded | |
43 | discard ticks milliseconds total wait time for discard requests | |
898bd37a | 44 | =============== ============= ================================================= |
37a32795 | 45 | |
bdca3c87 MC |
46 | read I/Os, write I/Os, discard I/0s |
47 | =================================== | |
37a32795 AI |
48 | |
49 | These values increment when an I/O request completes. | |
50 | ||
bdca3c87 MC |
51 | read merges, write merges, discard merges |
52 | ========================================= | |
37a32795 AI |
53 | |
54 | These values increment when an I/O request is merged with an | |
55 | already-queued I/O request. | |
56 | ||
bdca3c87 MC |
57 | read sectors, write sectors, discard_sectors |
58 | ============================================ | |
37a32795 | 59 | |
bdca3c87 MC |
60 | These values count the number of sectors read from, written to, or |
61 | discarded from this block device. The "sectors" in question are the | |
62 | standard UNIX 512-byte sectors, not any device- or filesystem-specific | |
63 | block size. The counters are incremented when the I/O completes. | |
37a32795 | 64 | |
bdca3c87 MC |
65 | read ticks, write ticks, discard ticks |
66 | ====================================== | |
37a32795 AI |
67 | |
68 | These values count the number of milliseconds that I/O requests have | |
69 | waited on this block device. If there are multiple I/O requests waiting, | |
70 | these values will increase at a rate greater than 1000/second; for | |
71 | example, if 60 read requests wait for an average of 30 ms, the read_ticks | |
72 | field will increase by 60*30 = 1800. | |
73 | ||
74 | in_flight | |
75 | ========= | |
76 | ||
77 | This value counts the number of I/O requests that have been issued to | |
78 | the device driver but have not yet completed. It does not include I/O | |
79 | requests that are in the queue but not yet issued to the device driver. | |
80 | ||
81 | io_ticks | |
82 | ======== | |
83 | ||
84 | This value counts the number of milliseconds during which the device has | |
85 | had I/O requests queued. | |
86 | ||
87 | time_in_queue | |
88 | ============= | |
89 | ||
90 | This value counts the number of milliseconds that I/O requests have waited | |
91 | on this block device. If there are multiple I/O requests waiting, this | |
92 | value will increase as the product of the number of milliseconds times the | |
93 | number of requests waiting (see "read ticks" above for an example). |