Wednesday, November 13, 2013

NCQ in linux

***NCQ referes to native command queuing which vendors claim to enhance disk drive performance.***
To check if your linux system uses it you must first go to your BIOS and see if AHCI (Advance Host Controller Interface) is supported and enabled for your hard disks/ssds.
Besides NCQ enableling AHCI will also allow you hot-plugging on the desired disk drive.

So let's get back to linux and check if it's correctly recognized :

root@server:~# dmesg | grep -i NCQ

[ 0.929873] ahci 0000:00:1f.2: flags: 64bit ncq led clo pio slum part ems apst
[ 1.289978] ata5.00: 5860533168 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[ 1.290001] ata4.00: 5860533168 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[ 1.290504] ata3.00: 5860533168 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[ 1.308894] ata1.00: 117231408 sectors, multi 16: LBA48 NCQ (depth 31/32), AA

and

root@vader:~# cat /sys/block/sd{a,b,c,d}/device/queue_depth
31
31
31
31

The commands above are showing the default behavior of your linux kernel that automatically enables NCQ if your hardware supports it.

If for some reason you want to disable NCQ you may issue the command :

echo 1 > /sys/block/sd{a,b,c,d}/device/queue_depth

No comments:

Post a Comment