While SSD are increasingly used in both enterprise and consumer machines, classical mechanical-based HDD are here to stay at least 5-10 more years: their sheer size (and accompanying low cost per GB) means that they will remain the primary storage backed inside most computers. For example, even where SSD are used, a classic HDD is used to store big and/or compressed data.

This also means that any improvement in HDD performance should be taken seriously: as they are (by far) the slower component that can be found inside modern servers and PCs, any improvement in I/O speed can have a direct positive effect on the performance of the entire setup.

Understanding this fact, enterprise-class drives and controllers have long ago acquired a capability called TCQ: an hardware-managed I/O queue that,  through carefully and smart requests reordering, can noticeably improve HDD performance under high queue depth (QD) scenarios. Even on the software side each piece was in place, as any UNIX/LINUX variant traditionally has a well written, high performing I/O stack with an additional I/O software queue that contribute to a even faster disk subsystem.

On the other hand, consumer-class disks were confined to the feature-poor IDE standard for decades, thus lacking any advanced features. However with modern SATA disk drives things became much more balanced: even consumer-class drives have now an hardware controlled I/O queue called NCQ and almost every PC integrate an Advanced Host Controller Interface (AHCI) disk controller capable of fully exploiting I/O queue capability. This combination is so cost efficient that many low-end servers now ship with SATA disk and use the integrated AHCI controller, completely ditching discrete hardware controllers.

This article will focus on how hardware (NCQ) and software controlled I/O queues, combined with different I/O schedulers, enable greater disk performance. As I am going to provide benchmarks measured with a single program, a little utility called "seeker", you must consider this article as a "first look". However I am sure you will find it interesting ;)