TopTechnical DictionaryNCQ (Native Command Queuing)

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.
Native command queuing was introduced with SATA-II interface drives (later partially implemented in SATA-I drives).

 

NCQ is supported by three key protocols:

- (Status Return Mechanism) - transferring data on completing one or more scheduled I/O operations. The host is not informed on the start of the I/O operation, however it receives a signal about the end of the operation.

- Reducing the number of interruptions up to one per scheduled I/O operation (Interrupt Aggregation) – the host should be informed about each completed I/O command. The tasks related to the data physically close to each on the drive are grouped and queued. It may lead to a situation where several I/O commands end at the same time or in short time one after each other. The information about completing all 32 operations can be transmitted in a single 64-bit package instead of 64 packages with NCQ disabled. SATA-I and ATA drives require two interruptions for each I/O operation (command start and end).

- Direct memory access mechanism (First Party DMA – FPDMA) – NCQ is designed for HDD to select the next data transfer task to complete. The drive sends an I/O command tag/ID to the host memory controller and reserves a space for buffered data directly in the internal memory. Thus, the drive can effectively change the order of the commands, and may reserve the space for the buffered data without involving the host software.

 

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.
An isochronous data transfer was also implemented to provide smooth transmission to high-throughput applications (audio/video) and parallel transfer for lower priority tasks.

 

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.
It could be observed in Linux systems with RAID-5 matrix. During the test, a lower priority task was completed after 57,118 ms (and after 2,021 ms with NCQ disabled). In 2008, Google Inc. performed a series of internal tests proving that under specific conditions, some scheduled I/O processes may be delayed by up to 2 seconds (in any operating system).
Those issues have been solved by introducing SATA-III interface – and adding "Deadline Handling" subcommand to the queue manager to control the time limit for I/O operations with the lowest priority.

 

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.

 


Net:0.00 USD
Gross:0.00 USD
Weight:0.00 kg
Especially recommended
AHD, HD-CVI, HD-TVI, PAL VANDALPROOF CAMERA APTI-H24V3-2812W - 1080p 2.8 ... 12 mm
APTI-H24V3-2812W

Net: 45.49 USD

ADAPTER TO POWER SUPPLY VIA TWISTED-PAIR CABLE POE-UNI
POE-UNI

Net: 1.88 USD

CHIMNEY CLAMP OK-43T13
OK-43T13

Net: 14.81 USD

AHD, HD-CVI, HD-TVI, CVBS, TCP/IP DVR DS-7204HUHI-K1 4 CHANNELS HIKVISION
DS-7204HUHI-K1

Net: 212.85 USD

Switch PoE GTS-B1-10-82G 10-PORT
GTS-B1-10-82G

Net: 100.16 USD

POWER SUPPLY ADAPTER 12V/5A/5.5
12V/5A/5.5

Net: 10.02 USD

CHIMNEY CLAMP OK-50W13
OK-50W13

Net: 13.50 USD

HANGING RACK CABINET EPRADO-R19-6U/450
EPRADO-R19-6U/450

Net: 74.34 USD

AHD, HD-CVI, HD-TVI, PAL CAMERA APTI-H14M-36 - 720p, 3.6 mm
APTI-H14M-36

Net: 43.82 USD

 
60-713 Poznań, Graniczna 10
tel.: +(48) 61 864 69 66
e-mail: shop@delta.poznan.pl
Working hours
Mon.-Fri.: 8.00 - 19.00
Sat.: 8.00 - 14.00
Sales Department, Shipments
tel.: +(48) 61 864 69 66
e-mail: shop@delta.poznan.pl
Technical Support
tel.: +(48) 61 864 69 98
e-mail: support@delta.poznan.pl
(c) 2001-2019 DELTA