Skip to main content

Arch Linux - I/O Scheduler festlegen

Je nach Datenträger-Typ und Situation kann es sinnvoll sein den Input/Output Scheduler manuell festzulegen, um die beste Performance zu erhalten.

Der aktuell im Einsatz befindliche I/O Scheduler kann mittels cat /sys/block/<block storage>/queue/scheduler abgefragt werden.

Folgende Config-Datei sorgt dafür, dass für HDD, SATA SSD und NVMe SSD jeweils der best geeignete I/O Scheduler zum Einsatz kommt.

/etc/udev/rules.d/ioschedulers.rules

# HDD: mq-deadline
ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="mq-deadline"

# Traditional (SATA) SSD: bfq
ACTION=="add|change", KERNEL=="sd[a-z]*|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq"

# NVMe SSD: none
ACTION=="add|change", KERNEL=="nvme[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="none"

Dies basiert auf folgenden Empfehlungen von Red Hat.

- None: Implements a first-in first-out (FIFO) scheduling algorithm. The none scheduler is recommended for systems that have high performance storage like Solid State Drives (SSD) or Non-volatile Memory Express (NVMe) drives. The default schedule for NVMe is none. 
- Mq-deadline: This scheduler groups queued I/O requests into batches. The I/O in the batches are organized by logical block addressing so that writes are organized by location to storage. The mq-deadline is suited for traditional HDD storage. 
- Bfq: This scheduler priorities latency rather than maximum throughput. The bfq disk scheduler is recommended for desktop or interactive tasks and traditional HDD storage. 
- Kyber: This scheduler tunes itself by analyzing I/O requests. A calculation is done with each IO test to determine if the I/O can be satisfied with the least amount of latency. Kyber is recommended for high performance storage like SSDs and NVMe drives.

Ein Reboot ist notwendig, um die Änderungen zu übernehmen.