Malinux' notes: Difference between revisions
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
== HDD hacks == | |||
=== Disable NCQ === | === Disable NCQ === | ||
Disabling NCQ (Native Command Queuing) can in some circumstances improve performance on HDD's | Disabling NCQ (Native Command Queuing) can in some circumstances improve performance on HDD's |
Revision as of 13:49, 21 November 2021
HDD hacks
Disable NCQ
Disabling NCQ (Native Command Queuing) can in some circumstances improve performance on HDD's
# To check if ncq is already off, its' likely not if you haven't already turned it off
cat /sys/block/sdX/device/queue_depth
# it will return 32 if it's on and 1 if it's turned off
# To turn it off:
echo 1 > /sys/block/sdX/device/queue_depth
To have this survive a reboot and disable ncq for all your hdd's or ssd's we can make a systemd script First we'll make a bash script that the systemd script run
#!/bin/bash
disker=$( lsblk -d | awk '/^sd/ { print $1 }' )
# echo $disker
for disk in $disker
do
q="/sys/block/$disk/device/queue_depth";
newq=1;
echo $newq > $q;
done
Put the script in /usr/local/bin/disable_ncq.sh and make it executable
chmod +x /usr/local/bin/disable_ncq.sh
Then we go on to make the systemd script itself.
Create /etc/systemd/system/disable-ncq.service and add:
# vim:isfname-==
[Unit]
Description=HDD queuing
[Service]
Type=oneshot
ExecStart=/usr/local/bin/disable_ncq.sh
[Install]
WantedBy=multi-user.target
Then we need to enable and start the script:
systemctl enable disable-ncq.sh
systemctl start disable-ncq.sh
BFQ I/O scheduler
I use BFQ btw. BFQ is a bloody fast I/O scheduler, best suitable with HDD's. source: https://wiki.archlinux.org/title/Improving_performance#Changing_I/O_scheduler