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

  • 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 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
  • Cisco CME How To Configure SIP Trunk VOIP
  • Virtualbox host Only Network Error Failed to save host network interface parameter - Cannot change gateway IP of host only network
  • Cisco CME and C7200 Router Testing and Learning Environment on Ubuntu 20+ Setup Tutorial Guide
  • Abusive IP ranges blacklist
  • How to Install Any OS on a Physical Drive from Windows Using VMware Workstation (Linux, Windows, BSD)
  • CDN Cloudflare how to set and preserve the real IP of the client without modifying application code on Apache
  • CentOS 7 fix Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was 14: curl#6 -
  • Ubuntu Debian How To Install Recommended Packages Automatically
  • How to set Linux Ubuntu Redhat Debian Command Line http https socks proxy for yum apt