I'm trying to increase my SSD's queue depth value with the following command:

echo 64 > /sys/block/sda/device/queue_depth

But I receive the following error:

bash: echo: write error: Invalid argument

I tried using tee and even editors like vim and nano but still see this error. There are 4 SSDs on this server (sd[a-d]) and this error occurs for all of them.

OS is CentOS 7 and kernel version is 3.10.0-327.18.2.el7.x86_64.


Maybe your SSD does not support this queue depth?

# hdparm -I /dev/sda


ATA device, with non-removable media
    Model Number:       M4-CT064M4SSD2                          
    LBA, IORDY(can be disabled)
    Queue depth: 32

Alternatively, try with 1, 2, 3, ... to find the maximum queue depth the kernel will allow you to use.

If it does not allow you to set values higher than 1, maybe your kernel has NCQ disabled in general. Check /proc/cmdline for libata.force=noncq or similar.

There have been some NCQ related bugs, with SSDs in particular. You should do some benchmarks to check whether NCQ benefits you in any way at all and some tests whether (queued) TRIM works without corrupting data (current kernels fix these issues only by blacklisting some devices).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.