Skip to main content

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.

Quick Summary

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.

SchedulerBehaviorTypical Fit
noneMinimal software scheduling; lets the device handle queuing.Often a good default for NVMe.
mq-deadlineFairness-focused scheduler that can reduce latency spikes.Common on SSD/HDD (and some NVMe).
bfqBudget Fair Queueing for interactive workloads.Typically desktop-oriented; uncommon on servers.
cfqLegacy 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.

probe-io-scheduler.sh
# Replace nvme0n1 with your block device
cat /sys/block/nvme0n1/queue/scheduler

Terminal Verification Output:

scheduler-output.txt
[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:

force-none-scheduler.sh
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.

caution

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.

edit-grub-config.sh
sudo nano /etc/default/grub

Locate the primary Linux command trajectory:

grub-configuration.ini
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Append the elevator declaration to execute identically across the hardware structure:

grub-configuration-edited.ini
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=none"

Compile the kernel updates safely:

commit-grub-update.sh
sudo update-grub
sudo reboot

Architectural Load Analysis​

  • Lower scheduler overhead: On NVMe, none can 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-deadline is often safer than none for latency consistency.

Common Mistakes & Troubleshooting​

Engineering OversightTechnical RamificationRectification Action
Choosing the wrong defaultUsing 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 rebootOutput reverts after a restart or host maintenance.Add a persistence mechanism (GRUB, udev rule, or your distro's supported approach).
Scheduler option missingSysfs 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.

What's Next​