# Measure physical disk request queue length?



## IT_Architect (Oct 27, 2010)

Is there a way to measure physical disk request queue length?

E.G. like the Windows:

```
\PhysicalDisk(0 C:)\Current Disk Queue Length
\PhysicalDisk(0 C:)\Avg. Disk Read Queue Length
\PhysicalDisk(0 C:)\Avg. Disk Write Queue Length
```

Failing that, the best performance indicators to use for FreeBSD disk performance.  (Disk writes are the killers)

Thanks!


----------



## fronclynne (Oct 27, 2010)

I'm not familiar with what Windows refers to as Queue length, are you talking about what you get when you issue `# camcontrol tags da0 -v` (I don't know what the ide/ata equivalent is, sorry)?


----------



## IT_Architect (Oct 27, 2010)

> I'm not familiar with what Windows refers to as Queue length



That's how many requests the disk is waiting to do or finish.


```
server# camcontrol tags da0 -v
(pass0:mpt0:0:0:0): dev_openings  127
(pass0:mpt0:0:0:0): dev_active    0
(pass0:mpt0:0:0:0): devq_openings 127
(pass0:mpt0:0:0:0): devq_queued   0
(pass0:mpt0:0:0:0): held          0
(pass0:mpt0:0:0:0): mintags       2
(pass0:mpt0:0:0:0): maxtags       255
server#
```

From the manual, it doesn't sound like the same thing:



> devq_queued:  This is the number of transactions waiting in the kernel queue for capacity on the device.  This number is usually zero unless error recovery is in progress.



Thanks!


----------



## mav@ (Oct 27, 2010)

`# gstat -I 1s` - first column is the current queue length. But not necessary that all that requests are submitted to the disk same time - there could be number of hardware/software limitations, like number of tags supported by hardware. If you need closer to hardware queue stats - dev_active is appropriate.


----------



## IT_Architect (Oct 27, 2010)

It appears dev_active is what I'm after.  My rationale is that when I track parameters in Zabbix, I want to track a parameter(s) that most closely correlates with user-perceived performance.  Split I/Os, transfer speeds for reads and writes, %disk utilization, etc. are not actionable information until the disk subsystem gets behind on disk requests.

dev_active I assumed was the equivalent of Windows "\PhysicalDisk(0 C:)\% Disk Time" (% busy) but it is not.  It is the equivalent of "\PhysicalDisk(0 C\Current Disk Queue Length" (queued request depth), which is exactly what I need.


----------



## fronclynne (Oct 28, 2010)

IT_Architect said:
			
		

> dev_active I assumed was the equivalent of Windows "\PhysicalDisk(0 C:)\% Disk Time" (% busy) but it is not.  It is the equivalent of "\PhysicalDisk(0 C\Current Disk Queue Length" (queued request depth), which is exactly what I need.



Ah, that's actually good to know.  The Magical World of Microsoft Terminology (such as it is) can be pretty obtuse to those of us who don't actually use it any more.  (I'm not excusing some of the loopy Linux/Unix/BSD terminology either)


----------



## DrTed (Jun 8, 2019)

I've been compiling a list of calculations to assist in tuning of ZFS. 
Finding and tracking disk queue length has been something of interest to me. gstat -I 1s 1s is one of my new fav tv shows lol


----------

