How do I display the current disk IO queue length on Linux?

KZcoding picture KZcoding · Nov 28, 2012 · Viewed 45.6k times · Source

I am working on a new IO scheduler for the Linux Kernel. I am trying to see if anyone knows of a tool that prints out total number of outstanding IO requests (Disk IO queue) in Linux?

I would be working from a terminal.

Thank you!

Answer

daveh picture daveh · May 18, 2015

Forgive the massive necro here. You actually want iostat -x which will display the extended stats for the device in question since last iostat was run. If you wish to monitor the queue in realtime you want iostat -xt 1 (or iostat -xmt 1 to show details in megabytes).

You can see the average queue size in the avgqu-sz column.

Consider the following example output from iostat -xmt 1 which shows a full IO queue (max queue length is 128 for this device) and a saturated disk during a benchmark.

18/05/15 00:41:05
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.00    0.00    0.00    6.02    0.00   93.98

Device:         rrqm/s   wrqm/s     r/s     w/s    rMB/s    wMB/s avgrq-sz avgqu-sz   await  svctm  %util
xvda              0.00     0.00    1.00 1308.00     0.00   163.50   255.81   133.30  101.15   0.76 100.00