Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 483
KZcoding Avatar asked Nov 28 '12 20:11

KZcoding


People also ask

How do I view disk IO?

By using iotop command, you can monitor the disk utilization by individual processes. You will get the following output: By typing the iotop command with o option, you will get the actual I/O activity. With the help of iostat command, you will get the individual hard disk I/O activity.

What is disk queue length?

Disk Queue Length, the higher the number the more disk operations are waiting. It requires attention if this value frequently exceeds a value of 2 during peak usage of SQL Server. If you have multiple drives you should take this number and divide by the number of drives in the array to see if the number is above 2.

How is IOPS measured in Linux?

The best way to check disk IOPS in Linux is using a command-line tool called iostat. This tool is part of the sysstat package, which is a collection of Linux system monitoring tools. The iostat command is used to monitor disk workload in real-time.


2 Answers

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 aqu-sz column (in previous versions avgqu-sz).

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
like image 159
daveh Avatar answered Oct 24 '22 19:10

daveh


dmitry@pro:~$ iostat 
          disk0       cpu     load average
    KB/t tps  MB/s  us sy id   1m   5m   15m
   50.70  34  1.70   4  3 93  1.83 1.65 1.70
dmitry@pro:~$ 

DESCRIPTION Iostat displays kernel I/O statistics on terminal, device and cpu opera- tions. The first statistics that are printed are averaged over the sys- tem uptime. To get information about the current activity, a suitable wait time should be specified, so that the subsequent sets of printed statistics will be averaged over that time.

like image 40
Dmitry Zagorulkin Avatar answered Oct 24 '22 18:10

Dmitry Zagorulkin