Linux – How does sar collect/calculate disk utilization %

linuxperformancesar

I'm pretty sure sar's disk utilization % shows how much of the disk is being utilized at any given time, but how does it calculate that? I found:

%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%.

In the sar man page, but that doesn't answer much for me – the CPU could be issuing I/O requests infinitely but that doesn't necessarily mean that the disk is at capacity – would it not be more appropriate to measure when requests start becoming latent as a ceiling for how hard a disk is being hit?

Best Answer

It depends on which kernel version are you using /proc/partitions or /sys/block/hda/stat or /proc/diskstats, but you answer your question thes file have all the required field to calculate CPU utilisation with sar.

Hope it will help you.