Disk utilization in iostat command is a key metric to check if a disk is busy or not in Linux. It is used to calculate the time percent that a disk was busy actively performing work during an interval. Hope this post can help you find out which disk is busy.
What is disk utilization in Iostat?
Iostat disk utilization is the percentage of time the device was busy processing I/O requests.
It is calculated by the OS as the time that disk was doing something.
When a disk at 90% utilization may be able to accept much more than an extra 10% of workload. But this disk is pretty busy now.
How to Check if a Disk is Busy In Linux?
We can use iostat command to monitor system input/output device loading. It can be executed by any user, and is typically the first command used to investigate disk I/O issues at the command line.
We can use iostat -xk interval to get the io status for our disks. The command output includes disk IOPS, bandwidth, latency etc. From the last column %util, we can see the disk utilization.
For example, iostat -xk 3 will print out the disk io status every 3 seconds. If the disk utilization is consistently high, that means this disk is busy.
The following is the official definition of disk utilization.
%util : Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100%.
Understanding Disk Utilization For Shared Disks
Disk utilization is a host-side metric. For example, in the SAN environment, one disk is shared with more than one server. In this case, the disk utilization on each server might be not same even though it is the same LUN on the storage side.
Note that disk utilization is an interval summary. Disk I/O can occur in bursts, especially due to write flushing, which can be disguised when summarizing over longer intervals.