Why is it recommended in a MD RAID (mdadm) to disable NCQ per-disk? echo 1 > /sys/block/sdX/device/queue_depth
I read this tip in many articles regarding RAID tuning but nobody explains why.
Why is it recommended in a MD RAID (mdadm) to disable NCQ per-disk? echo 1 > /sys/block/sdX/device/queue_depth
I read this tip in many articles regarding RAID tuning but nobody explains why.
Thanks for your answer.
Wikipedia states "NCQ can negatively interfere with the operating system's I/O scheduler, actually decreasing performance
" and it refers to this article
http://www.cs.albany.edu/~sdc/CSI500/Fal10/DiskArmSchedulingPapers/a2-yu.pdf
This article states "Under a random workload, the I/O scheduler should be disabled, that is, noop, and NCQ in charge of scheduling requests entirely; when under a sequential workload, an I/O scheduler should take full charge of scheduling them instead of NCQ. It implies that the type of information that can help scheduling decision can vary according to the workload type.
"
Thus it seems to be a problem under a sequential workload, but not under a random workload.
At conclusions it states that "In the long run, we suggest that a new SATA 2 specification should contain a well-defined interface to fully control NCQ mechanism.
"
But this article is rather old (March 2010) and I don't know if it has been solved.
From the Wikipedia article on NCQ:
NCQ can negatively interfere with the operating system's I/O scheduler, actually decreasing performance;[6] this has been observed in practice on Linux with RAID-5.[7] There is no mechanism in NCQ for the host to specify any sort of deadlines for an I/O, like how many times a request can be ignored in favor of others.