Linux How To Disable SATA NCQ For Better Performance

This is the closest way to disabling it without using the "libata.force=noncq" kernel boot option is to set the queue to a depth of 1 which doesn't actually disable it.

Change the sdc below to match the device you want to disable NCQ for.

[root@officebox ~]# echo "1" > /sys/block/sdc/device/queue_depth

Errors that indicate you are having a performance issue are these in messages or dmesg relating to NCQ and SATA bus timeout and reset are killing your IO performance!

 

Apr 12 12:12:50 officebox kernel: ata8: EH in SWNCQ mode,QC:qc_active 0x400FFFFF sactive 0x400FFFFF
Apr 12 12:12:50 officebox kernel: ata8: SWNCQ:qc_active 0x40000007 defer_bits 0xFFFF8 last_issue_tag 0x2
Apr 12 12:12:50 officebox kernel:  dhfis 0x40000003 dmafis 0x40000008 sdbfis 0x0
Apr 12 12:12:50 officebox kernel: ata8: ATA_REG 0x51 ERR_REG 0x84
Apr 12 12:12:50 officebox kernel: ata8: tag : dhfis dmafis sdbfis sacitve
Apr 12 12:12:50 officebox kernel: ata8: tag 0x0: 1 0 0 1 
Apr 12 12:12:50 officebox kernel: ata8: tag 0x1: 1 0 0 1 
Apr 12 12:12:50 officebox kernel: ata8: tag 0x2: 0 0 0 1 
Apr 12 12:12:50 officebox kernel: ata8: tag 0x1e: 1 1 0 1 
Apr 12 12:12:50 officebox kernel: ata8.00: exception Emask 0x1 SAct 0x400fffff SErr 0x0 action 0x6 frozen
Apr 12 12:12:50 officebox kernel: ata8.00: Ata error. fis:0x21
Apr 12 12:12:50 officebox kernel: ata8.00: failed command: WRITE FPDMA QUEUED
Apr 12 12:12:50 officebox kernel: ata8.00: cmd 61/08:00:bf:83:8b/00:00:02:00:00/40 tag 0 ncq 4096 out
Apr 12 12:12:50 officebox kernel:         res 51/84:10:d7:83:8b/84:00:02:00:00/40 Emask 0x10 (ATA bus error)
Apr 12 12:12:50 officebox kernel: ata8.00: status: { DRDY ERR }
Apr 12 12:12:50 officebox kernel: ata8.00: error: { ICRC ABRT }
Apr 12 12:12:50 officebox kernel: ata8.00: failed command: WRITE FPDMA QUEUED
Apr 12 12:12:50 officebox kernel: ata8.00: cmd 61/10:08:c7:83:8b/00:00:02:00:00/40 tag 1 ncq 8192 out
Apr 12 12:12:50 officebox kernel:         res 51/84:10:d7:83:8b/84:00:02:00:00/40 Emask 0x10 (ATA bus error)
Apr 12 12:12:50 officebox kernel: ata8.00: status: { DRDY ERR }
Apr 12 12:12:50 officebox kernel: ata8.00: error: { ICRC ABRT }
Apr 12 12:12:50 officebox kernel: ata8.00: failed command: WRITE FPDMA QUEUED
Apr 12 12:12:50 officebox kernel: ata8.00: cmd 61/18:10:d7:83:8b/00:00:02:00:00/40 tag 2 ncq 12288 out
Apr 12 12:12:50 officebox kernel:         res 51/84:10:d7:83:8b/84:00:02:00:00/40 Emask 0x10 (ATA bus error)
Apr 12 12:12:50 officebox kernel: ata8.00: status: { DRDY ERR }
Apr 12 12:12:50 officebox kernel: ata8.00: error: { ICRC ABRT }
Apr 12 12:12:50 officebox kernel: ata8.00: failed command: WRITE FPDMA QUEUED
Apr 12 12:12:50 officebox kernel: ata8.00: cmd 61/10:18:ef:83:8b/00:00:02:00:00/40 tag 3 ncq 8192 out
Apr 12 12:12:50 officebox kernel:         res 51/84:10:d7:83:8b/84:00:02:00:00/40 Emask 0x10 (ATA bus error)

:
 


Tags:

linux, disable, sata, ncq, performancethis, disabling, quot, libata, noncq, kernel, queue, depth, doesn, sdc, officebox, echo, sys, queue_depth, errors, indicate, dmesg, relating, timeout, reset, io, apr, ata, swncq, mode, qc, qc_active, fffff, sactive, defer_bits, xffff, last_issue_tag, dhfis, dmafis, sdbfis, ata_reg, err_reg, sacitve, exception, emask, sact, serr, fis, fpdma, queued, cmd, bf, res, drdy, err, icrc, abrt, ef,

Latest Articles

  • Apache PHP sending expires header solution cannot use cache with CDN
  • How to install virt-manager in Mint 22/Ubuntu 22
  • Infiniband Guide
  • python mysql install error: /bin/sh: 1: mysql_config: not found /bin/sh: 1: mariadb_config: not found /bin/sh: 1: mysql_config: not found mysql_config --version
  • FreePBX 17 How To Add a Trunk
  • Docker Container Onboot Policy - How to make sure a container is always running
  • FreePBX 17 How To Add Phones / Extensions and Register
  • Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes. solution
  • Cisco How To Use a Third Party SIP Phone (eg. Avaya, 3CX)
  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX 17 in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide
  • Linux Ubuntu Redhat How To Extract Images from PDF
  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format
  • Using Cisco CME Router with Asterisk as a dial-peer