Every few months someone posts a homelab “tuning guide” that tells you to switch every block device to bfq, or to none, or to set elevator=noop on the kernel command line. On a modern kernel most of that advice is either obsolete or actively wrong. The elevator= boot parameter belongs to the legacy block layer, noop was folded into none years ago, and on an NVMe drive with 64 hardware queues the scheduler is usually not your bottleneck.
What still matters: knowing which of the four remaining schedulers is active, why the kernel picked it, and which two tunables are worth touching for your actual workload. This guide covers that, with real commands and a benchmarking method that produces numbers you can trust.
Quick Verdict (TL;DR)
- NVMe (any workload): use
none. The device has deep hardware queues and reordering in software only adds latency. This is also the kernel’s default. - SATA SSD:
mq-deadlineis the sane default;noneis fine if the drive has Native Command Queuing and a deep queue. - Spinning disks (HDD):
mq-deadlinefor servers and bulk storage.bfqonly when interactive latency matters or you need proportional-share fairness between cgroups. - Kyber: a targeted-latency scheduler that works well on fast SATA/NVMe-adjacent devices when you want a predictable read latency target instead of throughput. Rarely the best choice, occasionally exactly right.
- Do not benchmark with
dd. It measures page cache. Usefiowith--direct=1, and measure latency percentiles, not just average throughput.
The Four Schedulers Side by Side
| Scheduler | Layer | Ordering strategy | Best device | CPU cost | Per-device tunables |
|---|---|---|---|---|---|
none | blk-mq only | None — requests go straight to the hardware queue | NVMe, fast SSD | Lowest | None |
mq-deadline | blk-mq | Deadline per request (read/write expiry), FIFO batches | SATA SSD, HDD, SAN LUNs | Low | read_expire, write_expire, writes_starved, fifo_batch |
bfq | blk-mq | Budget Fair Queueing — per-cgroup/process proportional share | HDD, desktop, multi-tenant I/O | Highest | low_latency, slice_idle, fifo_expire_async, weights |
kyber | blk-mq | Two implicit queues (read/write) with latency targets | Fast SSD, latency-sensitive services | Low | read_lat_nsec, write_lat_nsec |
Note the legend: with blk-mq (default since kernel 5.0), everything is a multi-queue scheduler. noop no longer exists as a separate entry — none replaced it. If a guide tells you to set elevator=noop, it was written for a kernel old enough to have security updates you are not installing.
Decision Matrix
| Situation | Scheduler | Reason |
|---|---|---|
| NVMe system disk, general server | none | Zero software reordering overhead; hardware queues are deep enough |
| Database on NVMe | none + cgroup io.latency | Scheduler cannot help; isolation must come from cgroups |
| 4-drive HDD RAID for backups | mq-deadline | Prevents write starvation of reads, cheap |
| Desktop / workstation with HDD | bfq | Per-process fairness keeps the UI responsive during large copies |
| Multi-tenant host, noisy neighbours | bfq + io.weight | Proportional share is BFQ’s core feature |
| Latency SLO on SATA SSD (e.g. log ingest) | kyber with a 1–2 ms read target | Explicit latency target instead of a queue-depth heuristic |
| Container host with mixed workloads | none + io.max / io.latency per slice | Enforce limits at the cgroup layer, not the scheduler |
Checking What Is Actually Active
| |
The bracketed entry is what the kernel selected. Selection is driven by the device’s rotational flag, queue depth, and the kernel config, not by a global default you can set once for all devices.
To change it per device, either write to sysfs directly (non-persistent) or ship a udev rule (persistent):
| |
| |
none — The Default That Wins on NVMe
none does no reordering and no merging in the scheduler. For NVMe this is correct: a modern enterprise NVMe exposes dozens of queues with 1,024 entries each, and the device firmware reorders internally. Inserting software sorting in front of that only adds a hop.
| |
The one legitimate reason to raise nr_requests on NVMe is a workload with very deep queues that is hitting queue full throttling. Watch iostat -x 1 for elevated aqu-sz combined with high latency — that is queue pressure, not scheduler misconfiguration.
mq-deadline — The Server Default for Rotational Media
mq-deadline assigns a deadline to every request and serves the oldest-expired first, while batching requests that are physically adjacent. It is a good compromise for SATA SSDs, HDDs, and — importantly — for network block devices, where the “device” is another machine and reordering is cheap insurance.
The four tunables live in /sys/block/<dev>/queue/iosched/:
| |
read_expire and write_expire are in milliseconds. Lower values improve read latency at the cost of throughput; on a backup array where writes dominate, raise write_expire to 10000 and leave reads at 500.
BFQ — Proportional Share, Not Throughput
BFQ (CONFIG_IOSCHED_BFQ) is the only scheduler here that implements per-process and per-cgroup proportional sharing inside the block layer. Its cost is CPU time per request: on a fast NVMe it can measurably reduce peak IOPS, which is why distributions do not enable it by default on servers.
It is the right answer in exactly two situations: spinning disks on a desktop, and multi-tenant hosts where one container must not starve the others.
| |
With cgroup v2, BFQ weights are set through the standard io.weight interface rather than BFQ-specific knobs — which is the correct way to do QoS, because it survives scheduler changes:
| |
For hard ceilings and latency protection, cgroup v2 offers io.max (absolute IOPS/bandwidth caps) and io.latency (protects a cgroup’s latency target by throttling others). Both are enforced regardless of which scheduler is active, which makes them the more portable investment.
Kyber — Explicit Latency Targets
Kyber keeps two queues (reads and writes) and tries to hit a configured latency target by adjusting how many requests it dispatches per cycle. That is a different control model from deadline-based scheduling: you tell it the latency you want, and it self-tunes the depth.
| |
It works best on devices that are fast but not infinitely parallel — SATA SSDs, mid-range NVMe, and virtio disks on a busy hypervisor. On a high-end NVMe, none still wins; on an HDD, mq-deadline is more appropriate because Kyber does not model seek cost.
Benchmarking That Produces Usable Numbers
fio (axboe/fio, 6,437 stars, last push 2026-11-24) is the only tool worth using for this. Three rules: use --direct=1 to bypass page cache, test the device for read workloads, and test a file for write workloads so you do not destroy a filesystem.
| |
Read the p99 and p99.9 latency lines, not the average. Two schedulers can post identical average IOPS while one shows a 40 ms p99 and the other 4 ms — for anything user-facing, the tail is the metric.
For latency distribution without re-running benchmarks, use biolatency from bcc, or the equivalent script in the bpftrace repository (bpftrace/bpftrace, 10,445 stars, last push 2026-11-24):
| |
After changing a scheduler, re-run the identical fio job. If p99 latency did not move by more than 10%, revert — schedulers are not a substitute for fixing a saturated device.
Tuning the block layer is only one layer of the stack. If your queue depth is the actual limit, see async I/O engines compared; if memory pressure is evicting your cache, transparent hugepages tuning is the next stop; and for enforcing I/O limits per service, the cgroup v2 administration guide covers io.max, io.weight, and io.latency in depth. If your block device is remote, read the NVMe over Fabrics guide first — scheduler tuning cannot fix network latency.
Pitfalls That Waste Weeks
- Using
elevator=noopon the kernel command line. It belongs to the legacy block layer; on current kernels it is ignored or invalid, andnoophas been replaced bynonefor years. - Benchmarking without
--direct=1. You are measuring RAM, not the disk. Every “my NVMe does 8 GB/s” claim built onddis a page-cache measurement. - Write-testing a raw device.
fio --filename=/dev/sda --rw=writedestroys the filesystem. Always use a scratch file for write tests. - Setting
bfqon NVMe “for fairness”. You lose peak throughput and gain little; use cgroupio.weightinstead, which is scheduler-independent. - Editing sysfs and expecting persistence.
/sysresets on reboot. Ship a udev rule. - Judging by average latency. Tail latency is what users feel; collect p99 before and after every change.
- Ignoring
nr_requestsand queue depth. A 32-deep queue on a device that supports 1,024 leaves performance on the table for some workloads, and an over-deep queue inflates latency for others.
FAQ
Which I/O scheduler does Linux use by default in 2026?
For NVMe devices the kernel selects none, and for SATA devices mq-deadline is the common distribution default. Because blk-mq is the only block layer, all schedulers are multi-queue, and noop no longer exists as a separate option.
Is none always faster than mq-deadline on NVMe?
For most workloads yes, because the device has deep hardware queues and reorders internally. The exception is a device or virtual disk with a shallow queue where deadline-based ordering prevents write starvation — measure p99 latency both ways rather than assuming.
When should I use BFQ? On spinning disks where interactive responsiveness matters, and on multi-tenant hosts that need proportional-share fairness between processes or cgroups. It has the highest CPU cost per request and generally lowers peak throughput on NVMe.
What replaced the elevator= kernel parameter?
Per-device configuration through /sys/block/<dev>/queue/scheduler, usually persisted with a udev rule. The legacy elevator= parameter applied to the old single-queue block layer and is not the right mechanism on modern kernels.
How do I limit one container’s disk usage without changing the scheduler?
Use cgroup v2 interfaces: io.max for hard caps, io.weight for proportional sharing, and io.latency to protect a service’s latency target. These are enforced at the cgroup layer and work with any scheduler.
Can scheduler tuning fix high disk latency? No, if the device is saturated. Scheduler tuning changes the order and fairness of requests; it cannot create bandwidth. Fix saturation with faster media, more parallelism, or by moving load — then tune the scheduler for the tail.
💰 想测试你的市场判断力?我用 Polymarket 做预测市场交易——这是全球最大的预测市场平台,从大选结果到技术监管时间线,什么都可以押注。和赌博不同,这是真正的信息市场:你懂的信息越多,胜率越高。我靠预测技术相关事件的走向已经赚了不少。用我的邀请链接注册:Polymarket.com