recently I was asked this question during a phone interview. I know that iostat command can be used to check disk performance in Linux. But I am not sure how to answer this question. Does this mean the disk is fully loaded? Thanks.
-
Have you tried to research the answer to this question yourself? I searched for 'iostat %util' and each of the first three hits explained what the output meant.– doneal24Commented Nov 26, 2022 at 16:48
-
Questions that don't show any effort on your part to research the answer are generally ill-received. You should add in any efforts you've made and possibly any partial understandings you've come to.– doneal24Commented Nov 26, 2022 at 16:50
1 Answer
You cannot determine how much I/O load is present from %util. It only represents the percentage of sample time during which at least one io was outstanding within the scheduler/driver/storage.
So with iostat 1 (sample rate of 1 second), a %util of 75% means there was at least 1 io outstanding to storage 750 milliseconds of the total 1 second sample time.
it does not represent anything useful in terms of actual load except in the case where you are dealing with a single physical disk.In the case of a single physical disk (such as a direct attached SATA disk), %util represents roughly what percentage of the time the disk was working on an io.
With a single physical disk and its single physical disk head, once iostat reaches 100% then no additional io work can be done AT THAT LOAD POINT.
Where the load point is comprised of the size of the io, the ratio of reads versus writes, how random or sequential that load is. Determining a load alarm limit is highly dependent upon both the storage technology being used AND the application.
I had one experience testing the performance of one storage product. I use fio tool on Linux system side.
I can still add more workload to the disks even the utilization went to 100%.
fio --name=fiotest --filename=/xxx/fiotest --size=16Gb --rw=write --bs=1M --direct=1 --numjobs=8 --ioengine=libaio --iodepth=8 --group_reporting --runtime=60
Device r/s w/s rkB/s wkB/s rrqm/s wrqm/s %rrqm %wrqm r_await w_await aqu-sz rareq-sz wareq-sz svctm %util
sdf 0.00 **2269.67** 0.00 **774805.33** 0.00 **9833.67** 0.00 **81.25** 0.00 **27.00 61.28** 0.00 **341.37 0.44 99.97**
sdd 0.00 **2267.33** 0.00 **774144.00** 0.00 **9835.33** 0.00 **81.27** 0.00 **25.49 57.78** 0.00 **341.43 0.44 99.97**
sde 0.00 **2270.67** 0.00 **775061.33** 0.00 **9833.33** 0.00 **81.24** 0.00 **26.11 59.30** 0.00 **341.34 0.44 99.97**
avg-cpu: %user %nice %system %iowait %steal %idle
Starting 8 processes
Jobs: 8 (f=0): [f(8)][100.0%][w=519MiB/s][w=518 IOPS][eta 00m:00s]
fiotest: (groupid=0, jobs=8): err= 0: pid=10248: Thu Oct 20 03:26:28 2022
write: IOPS=2002, BW=2003MiB/s (2100MB/s)(117GiB/60040msec); 0 zone resets
fio --name=fiotest --filename=/xxx/fiotest --size=16Gb --rw=read --bs=1M --direct=1 --numjobs=8 --ioengine=libaio --iodepth=8 --group_reporting --runtime=60
Device r/s w/s rkB/s wkB/s rrqm/s wrqm/s %rrqm %wrqm r_await w_await aqu-sz rareq-sz wareq-sz svctm %util
sdf **2271.33** 0.00 **775146.67** 0.00 **9842.00** 0.00 **81.25** 0.00 **25.91** 0.00 **58.85 341.27** 0.00 **0.44 99.63**
sdd **2264.67** 0.00 **774464.00** 0.00 **9846.67** 0.00 **81.30** 0.00 **25.02** 0.00 **56.67 341.98** 0.00 **0.44 99.43**
sde **2272.33** 0.00 **775061.33** 0.00 **9841.00** 0.00 **81.24** 0.00 **25.36** 0.00 **57.62 341.09** 0.00 **0.44 99.77**
dm-7 **36341.33** 0.00 **2325845.33** 0.00 0.00 0.00 0.00 0.00 **25.42** 0.00 **923.68 64.00** 0.00 **0.03 100.07**