/proc/diskstats interface
The /proc/diskstats interface in Alibaba Cloud Linux 2 allows you to query the I/O information on a disk and the amount of time consumed by read, write, and discard operations on a device.
Run the following command to query the /proc/diskstats interface:
The following command output is returned:
254 0 vda 6328 3156 565378 2223 1610 424 25160 4366 0 1358 5332 0 0 0 0 2205 3347 0
In the command output, the last three fields are new fields in Alibaba Cloud Linux 2. The following table describes all fields.
Field | Description |
The first field | The total number of completed read operations. |
The second field | The number of merged read operations. |
The third field | The number of sectors from which data was read. |
The fourth field | The amount of time consumed by all read operations. Unit: milliseconds. |
The fifth field | The total number of completed write operations. |
The sixth field | The number of merged read operations. |
The seventh field | The number of sectors to which data was written. |
The eighth field | The amount of time consumed by all write operations. Unit: milliseconds. |
The ninth field | The number of ongoing I/O operations. |
The tenth field | The amount of time consumed by I/O operations. Unit: milliseconds. |
The eleventh field | The amount of weighted time consumed by I/O operations. Unit: milliseconds. |
The twelfth field | The total number of completed discard operations. |
The thirteenth field | The number of merged discard operations. |
The fourteenth field | The total number of sectors from which data was discarded. |
The fifteenth field | The amount of time consumed by all discard operations. Unit: milliseconds. |
The sixteenth domain | The amount of time consumed by read operations on the device. Unit: milliseconds. |
The seventeenth domain | The amount of time consumed by write operations on the device. Unit: milliseconds. |
The eighteenth domain | The amount of time consumed by discard operations on the device. Unit: milliseconds. |
Install and use the BCC toolset
Alibaba Cloud Linux 2 provides the BCC toolset to track I/O latency.
Run the following command to download the BCC toolset:
Run one of the following commands to query the description of the BCC toolset: