Queue depth explained: how SSD benchmarks load a drive

Updated

Queue depth is the number of I/O requests waiting to be processed by a storage device. Benchmarks use different queue depths to simulate light and heavy workloads. Higher queue depths can increase throughput but may increase latency.

Queue depth explained: how SSD benchmarks load a drive
Photo: 4300streetcar, CC BY 4.0

What is queue depth

Queue depth is the number of input/output (I/O) operations that are pending at the same time in a storage device's queue. In a benchmark, a queue depth of 1 means the drive handles one request at a time, while a queue depth of 32 means 32 requests are waiting. The fio documentation explains that fio can simulate a given I/O workload by spawning threads or processes that issue I/O actions as specified by the user.

Modern solid state drives can process many requests in parallel, so higher queue depths often lead to higher throughput. However, the relationship is not linear, and the optimal queue depth depends on the drive's architecture and the workload. The Linux kernel's blk-mq documentation describes how the multi-queue mechanism enables fast storage devices to achieve a huge number of IOPS by submitting I/O requests simultaneously, benefiting from the parallelism of modern storage.

Benchmarks like CrystalDiskMark let users choose the queue depth for each test. The CrystalDiskMark page notes that results depend on test file size, position, fragmentation, controller, and CPU speed, among other factors. Understanding queue depth helps interpret these results.

How benchmarks use queue depth

Benchmark tools typically test at several queue depths to show how a drive performs under different levels of concurrency. For example, a queue depth of 1 represents a single-threaded application, while a queue depth of 32 or higher simulates a busy server with many simultaneous requests. The SNIA Solid State Storage Performance Test Specification defines device-level tests and methodologies for comparative testing of solid state storage devices for enterprise and client systems.

When reading benchmark results, it is important to note the queue depth used for each measurement. A drive that performs well at queue depth 1 may not scale as well at higher depths, and vice versa. The Solidigm white paper on PCIe Gen 4 SSDs advises mapping drive capabilities to application requirements by understanding the I/O profile of the target workload.

For a typical user, a queue depth of 1 or 2 reflects everyday tasks like booting an operating system or opening applications. Higher queue depths are more relevant for data centers or workstations running virtual machines or databases. The NVM Express organization states that NVMe was created to expose the benefits of non-volatile memory in all computing environments, from mobile to data center, and is widely considered the industry standard for PCIe SSDs.

Queue depth and performance metrics

Throughput, measured in MB/s, and IOPS (input/output operations per second) are the two main metrics reported by benchmarks. At low queue depths, latency dominates, and throughput is limited by the drive's response time. At higher queue depths, the drive can overlap operations, increasing throughput and IOPS, but latency for individual requests may rise.

The fio documentation describes how fio can be used to test specific workloads, including different queue depths, to find performance limits or reproduce bugs. Similarly, CrystalDiskMark offers various measure modes, such as Peak and Real World, which use different queue depths and access patterns, as noted on the CrystalDiskMark page.

When comparing drives, it is essential to compare results at the same queue depth and with the same test settings. The SNIA specification aims to enable manufacturers to set and customers to compare performance specifications, providing a common methodology for testing.

Practical considerations

For most consumer workloads, a queue depth of 1 to 8 is sufficient. Higher queue depths are more relevant for enterprise environments where many applications access storage concurrently. The Solidigm white paper notes that read-dominant workloads now account for about 94% of enterprise workloads, and such workloads may benefit from drives that handle high read queue depths efficiently.

When choosing a drive, consider the queue depth that matches your typical usage. For example, a laptop used for programming might benefit from a drive with strong low-queue-depth performance, as many developer tools issue small, random reads. For more demanding tasks, such as video editing or running virtual machines, higher queue depth performance becomes more important. Those who need a portable machine for coding might also consider the overall system performance, as discussed in guides for laptops for developers.

Benchmark results should be interpreted with caution because real-world performance depends on many factors beyond queue depth, including the file system, driver, and workload mix. The Linux kernel's blk-mq documentation explains that the block layer can merge requests and reorder them to improve performance, which can affect benchmark results.

How a benchmark loads a drive at different queue depthsStep 1: Benchmark issues I/O requests; Step 2: Requests enter the drive queue; Step 3: Drive processes requests in parallel; Step 4: Results are measured at each depth; Step 5: Compare performance across depthsHow a benchmark loads a drive at differentqueue depthsBenchmark issues I/O requestsRequests enter the drive queueDrive processes requests in parallelResults are measured at each depthCompare performance across depths
How a benchmark loads a drive at different queue depths
Common queue depths and typical use cases
Queue depthTypical workloadPerformance focus
1Single-threaded applications, bootLow latency
2-4Office work, web browsingBalanced
8-16Gaming, content creationHigher throughput
32-64Databases, virtualizationHigh IOPS
128+Enterprise servers, heavy I/OMaximum throughput

Frequently asked questions

What does queue depth mean in SSD benchmarks?

Queue depth is the number of I/O requests that are pending at the same time. A higher queue depth means more requests are waiting to be processed, which can increase throughput but may also increase latency.

Why do benchmarks test at different queue depths?

Different queue depths simulate different workloads. Low queue depths represent light, single-threaded tasks, while high queue depths represent heavy, multi-threaded server workloads. Testing at multiple depths shows how a drive scales.

What queue depth is appropriate for everyday use?

For typical consumer tasks like booting, web browsing, and office work, a queue depth of 1 to 8 is usually sufficient. Higher queue depths are more relevant for servers or demanding applications.

Does a higher queue depth always mean better performance?

Not necessarily. While higher queue depths can increase throughput and IOPS, they can also increase latency. The optimal queue depth depends on the drive's design and the workload.

How can benchmark results from different sources be compared?

Ensure that the queue depth, test file size, and other settings are the same. Standards like the SNIA Performance Test Specification provide methodologies for consistent testing.