Linux hard disk performance analysis command
Command:
Iostat-x-k 1
Command parameter description:
-X // obtain more statistics
-K // some powers that use block as the unit use Kilobytes as the unit
1 // data display refresh every 1 second
See an output instance:
Output description:
Device // Device object
Rrqm/s // Number of merge read operations per second. That is, delta (rmerge)/s
Wrqm/s // Number of write operations performed on merge per second. That is, delta (wmerge)/s
R/s // The number of read I/O devices per second. That is, delta (rio)/s
W/s // Number of write I/O devices completed per second. That is, delta (wio)/s
RkB/s // Number of read K bytes per second. It is half of rsect/s because the size of each slice is 512 bytes. (Computing required)
WkB/s // number of k bytes written per second. Half of wsect/s. (Computing required)
Avgrq-sz // average data size (slice) of each device I/O operation ). Delta (rsect + wsect)/delta (rio + wio)
Avgqu-sz // average I/O queue length. That is, delta (aveq)/s/1000 (because aveq is measured in milliseconds ).
Await // average wait time (in milliseconds) for each device I/O operation ). That is, delta (ruse + wuse)/delta (rio + wio)
Svctm // average service time for each device I/O operation (MS ). That is, delta (use)/delta (rio + wio)
% Util // The percentage of time in one second is used for I/O operations, that is, delta (use)/s/1000 (because use is measured in milliseconds)
How can I use this data to analyze problems?
1. If % util has a high probability of 100%, it indicates that too many I/O requests are generated and the I/O system is fully loaded. This disk may have a bottleneck.
2. Generally, svctm is smaller than await (because the wait time of the simultaneously waiting request is calculated repeatedly ).
The size of the svctm is generally related to the disk performance. The CPU/memory load will also affect the capacity of the svctm. Excessive requests may indirectly increase the capacity of the svctm.
If svctm is close to await, I/O has almost no waiting time.
If await is much larger than svctm, it indicates that the I/O queue is too long and the response time of the application is slow;
If the response time exceeds the allowable range (% util100 %), you can consider changing the disk faster.