I/O Scheduler
The Linux I/O scheduler controls how read and write requests are queued before they reach your storage device. On modern SSD/NVMe, the device firmware already handles queuing efficiently, so an overly heavy scheduler can add overhead or increase tail latency. This page shows how to check the current scheduler and set a sensible default for WordPress workloads.
On many NVMe-backed servers, using the none scheduler reduces software scheduling overhead and can improve consistency under database load. For SATA SSD/HDD, mq-deadline is commonly used to reduce latency spikes and keep queues fair.
The Algorithmic Hierarchy
Modern Linux block schedulers are stripped down to perform cleanly across multiqueue systems.
| Scheduler | Behavior | Typical Fit |
|---|---|---|
none | Minimal software scheduling; lets the device handle queuing. | Often a good default for NVMe. |
mq-deadline | Fairness-focused scheduler that can reduce latency spikes. | Common on SSD/HDD (and some NVMe). |
bfq | Budget Fair Queueing for interactive workloads. | Typically desktop-oriented; uncommon on servers. |
cfq | Legacy scheduler on older kernels. | Deprecated/obsolete on modern multiqueue systems. |
Note: In the sysfs output, the active scheduler is shown in brackets (example: [mq-deadline] kyber none).
Direct Implementation Protocols
Check the Current Scheduler
Probe the Linux root block device specifically to identify the active configuration string.
# Replace nvme0n1 with your block device
cat /sys/block/nvme0n1/queue/scheduler
Terminal Verification Output:
[mq-deadline] kyber none
This indicates the active scheduler is mq-deadline.
Set the Scheduler (Temporary)
Surgically overwrite the kernel logic specifically targeted at the NVMe path bypassing Linux intervention:
echo none | sudo tee /sys/block/nvme0n1/queue/scheduler
Re-run the probe command and confirm the output shows none as the active scheduler.
Persist Across Reboot (GRUB)
Because sysfs values reset on reboot, you need a persistence method if you want this to survive restarts.
Editing GRUB requires a reboot. Ensure you have console access and understand how to revert the change if the system fails to boot. The elevator= parameter sets a default scheduler and may affect multiple disks.
sudo nano /etc/default/grub
Locate the primary Linux command trajectory:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
Append the elevator declaration to execute identically across the hardware structure:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=none"
Compile the kernel updates safely:
sudo update-grub
sudo reboot
Architectural Load Analysis
- Lower scheduler overhead: On NVMe,
nonecan reduce software work in the I/O path. - More consistent DB latency: For database-heavy workloads, reducing I/O wait helps stabilize uncached request time.
- HDD/legacy storage: On HDD (and some SSDs),
mq-deadlineis often safer thannonefor latency consistency.
Common Mistakes & Troubleshooting
| Engineering Oversight | Technical Ramification | Rectification Action |
|---|---|---|
| Choosing the wrong default | Using none on certain storage can increase latency under load. | Switch back to mq-deadline (either in GRUB or by setting the device scheduler directly). |
| Scheduler resets after reboot | Output reverts after a restart or host maintenance. | Add a persistence mechanism (GRUB, udev rule, or your distro's supported approach). |
| Scheduler option missing | Sysfs output doesn't show expected schedulers. | The kernel/storage stack may not support them (or your host restricts it). Verify kernel version and provider capabilities. |