Queue Depth Calculator: Little’s Law for Storage

This queue depth calculator applies Little’s Law to storage: give it any two of IOPS, latency and queue depth and it solves for the third. It also checks whether a fleet of hosts could overrun the queue limit of a target port, and multiplies out NVMe queues and entries. Use it to choose queue depth settings with a number behind them instead of a guess.

Result

The result updates automatically as you change any input.

Formula and worked steps
Formulas used
  • Little's Law: QD = IOPS x latency (seconds)
  • IOPS = QD / latency
  • Latency = QD / IOPS
  • Outstanding at port = hosts x LUNs x per-LUN QD / ports
  • Max safe per-LUN QD = floor(port limit x ports / (hosts x LUNs))
  • NVMe outstanding = queues x entries per queue
Assumptions
  • Little's Law holds for a stable system: average outstanding I/Os = average arrival rate x average time in the system.
  • Port queue limits are vendor- and model-specific. Enter the figure from your array documentation.
  • The port check is worst case: every host fills every LUN queue and I/O is spread evenly across ports.
  • NVMe queue counts and depths are limited by the device and driver; enter what your hardware supports.
References

What is queue depth?

Queue depth is the number of I/O requests outstanding at the same time, issued but not yet completed. It exists at several levels, and each level has its own limit.

Outstanding I/Os

A host can send many requests without waiting for each to finish. The device, array or network works on several at once. Having enough outstanding I/Os keeps the device busy, and too many only makes requests wait in line.

Where queues live

There are queues in the application, the operating system, the HBA, the LUN or device, and the target port on the array. The effective depth is limited by the smallest of them. The calculator covers the per-LUN depth and the target port, which are the two most often misconfigured in shared SANs.

NVMe queues

NVMe devices use many submission queues, each with its own depth, so a drive can have thousands of commands outstanding. The total is the number of queues multiplied by the entries in each.

How the queue depth calculator works

Little’s Law says the average number of items in a stable system equals the arrival rate multiplied by the average time each spends there. For storage, outstanding I/Os equal IOPS multiplied by latency in seconds.

Formulas

  • Queue depth = IOPS x latency (seconds)
  • IOPS = queue depth / latency (seconds)
  • Latency = queue depth / IOPS
  • Outstanding per port = hosts x LUNs per host x per-LUN depth / ports
  • Maximum safe per-LUN depth = floor(port limit x ports / (hosts x LUNs))

Worked example: solving for each variable

A device serving 10,000 IOPS at 0.5 ms average latency has 10,000 x 0.0005 = 5 I/Os outstanding. A queue depth of 32 at 2 ms delivers 32 / 0.002 = 16,000 IOPS. A queue depth of 8 at 4,000 IOPS means each I/O takes 8 / 4,000 = 2 ms.

Why more depth does not mean more IOPS

Suppose a device tops out at 20,000 IOPS. At queue depth 32 the latency is 32 / 20,000 = 1.6 ms. At 128 it is 6.4 ms, with no extra IOPS. Past saturation, extra depth is pure waiting time, which is why tuning up a queue depth can make an application slower.

Host, HBA and device limits

The per-LUN setting is only one ceiling. The operating system, each HBA and the device have their own limits, and the effective depth is the smallest that applies. If you raise one setting and see no change, another level is probably the constraint, so check them in order from the application down to the array.

Worked example: a shared target port

Twenty hosts each see 10 LUNs with a per-LUN depth of 32. If every queue fills, 20 x 10 x 32 = 6,400 commands are outstanding. Spread over two target ports with a 2,048-command limit each, that is 3,200 per port, or 156% of the limit. The maximum safe per-LUN depth is floor(2,048 x 2 / 200) = 20. At depth 20, the worst case is exactly at the limit.

Why it matters for SAN and storage admins

Queue depth is a shared resource. One host with an aggressive setting can fill a target port and cause queue-full responses for every other host. The queue depth calculator makes that fan-in visible before it becomes an outage. It also explains the common tuning trade-off: a deeper queue helps throughput for a single busy host and hurts latency for everyone when the array is shared.

The same arithmetic helps you read monitoring. If a database reports a queue of 40 and the device latency is 2 ms, Little’s Law says the host is asking for 20,000 IOPS. If the array only delivers 12,000, the difference is queueing, and the next step is to look at the device, not the host settings.

Use it when you:

  • Set per-LUN or per-HBA queue depths on new hosts.
  • Check that a new group of hosts will not overrun target port limits.
  • Estimate what latency to expect at a given load.
  • Translate an NVMe configuration into its maximum outstanding I/Os.

Best practices and common mistakes

  • Take port limits from the array documentation. They differ by vendor and model.
  • Plan for the worst case, then relax it using measured concurrency.
  • Change one level at a time and measure latency as well as IOPS.
  • Keep per-LUN depth consistent across hosts that share a port.
  • Watch for queue-full counters on arrays and hosts. They show that a limit is being hit.
  • Use average latency at the right level. Application latency includes queueing, while device latency does not.

A frequent mistake is to raise queue depth to fix a latency problem. If the device is already saturated, the latency is the queue, and a deeper queue makes it worse.

FAQs

What is Little’s Law for storage?

Average outstanding I/Os equal IOPS times average latency in seconds. At 10,000 IOPS and 0.5 ms, the queue depth is 5.

Does a higher queue depth always raise IOPS?

No. Once the device is saturated, more queue depth only adds latency. At 20,000 IOPS maximum, a depth of 32 gives 1.6 ms and 128 gives 6.4 ms.

What happens when a target port queue is exceeded?

The target returns a queue-full or task-set-full status, and hosts usually slow down, which shows up as latency spikes. Lower the per-LUN depth or add target ports.

Next, try the IOPS calculator, the storage block size calculator and the bandwidth unit converter, or browse the full list of storage calculators.