NCQ (Native Command Queuing)
NCQ is a software-based extension of SATA interface in which received read and write commands are queued to improve efficiency (number of I/O per second) of both HDDs and SSDs. |
In standard HDDs, up to 32 commands are buffered and queued to perform scheduled tasks with a minimum number of platter turns and head movements. It reduces the time required for I/O operations as well as the overall degradation of electromechanical components. |
Fig. 1 Read/write operations: (a) NCQ disabled, (b) NCQ enabled |
HDD shown in Fig. 1 performs I/O operations: (a) with NCQ disabled - in a sequence from A to F, while performing 3.5 platter turns; (b) with NCQ enabled - in the following sequence C → A → B → D → F → E while performing two complete platter turns. |
NCQ is an extension of the queuing concept used in TCQ (Tagged Command Queuing) technology, previously implemented in SCSI and ATA drives and partially implemented in SATA-I drives. It differs from its precursor by the number of subsequent processed I/O operations and allows issuing the next command by the host while performing other tasks. |
NCQ is supported by three key protocols: |
Many new NCQ functions were introduced in SATA-III interface. The improvements included queueing management and commands for improved streaming of multimedia content by allowing the host to send information on operations to be stopped or assigned a higher priority. As a result, general system performance, as well as the number of I/O operations per second were improved. |
NCQ implemented in SATA-II interface may also affect the performance of scheduled I/O tasks and reduce the operating system performance. The algorithm does not assign time slots for individual I/O operations, and the number of times a specific scheduled I/O operation can be moved to the end of the queue is not limited. Execution of a specific I/O command could have been delayed by other queries leading to process starvation. |
Due to the SSD drive design (multiple NAND memory chips connected to a single controller and no mechanical components), NCQ tasks are performed using a deep queueing function where the scheduled I/O tasks are grouped by the controller and run on multiple NAND memory chips. |
NCQ is supported by HDD/SSD drives with a compatible controller only. |