stat.txt 3.6 KB

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