An I/O scheduler, also called a disk scheduler, is the operating system component that decides in which order pending read and write requests are sent to a block device. In the area of Drivers & devices within operating systems, it sits between the file system and the device driver, where it can merge, reorder and delay requests to improve throughput, reduce latency or share bandwidth fairly among processes.
The I/O scheduler was originally designed to minimize mechanical seek time on hard disks. With fast SSDs and NVMe drives that have their own internal queues, its role has shifted toward latency control and fairness, and in many configurations the best choice is to do almost nothing.
How an I/O scheduler processes requests
An I/O scheduler processes requests by collecting them in software queues, applying a policy, and dispatching them to the driver when the device can accept more work. Each request describes a direction, a starting sector and a length, which gives the scheduler enough information to detect adjacency and estimate cost.
Two core operations do most of the work. Merging joins a new request with an adjacent queued request so that the device receives one larger transfer instead of several small ones. Sorting orders requests by sector or by deadline, so a hard disk head sweeps across the platter instead of jumping back and forth.
The table summarizes the basic operations that a scheduler can apply.
| Operation | What it does | Main benefit |
|---|---|---|
| Front and back merging | Joins requests for adjacent sectors | Fewer, larger transfers |
| Sector sorting | Orders requests by disk position | Shorter seeks on hard disks |
| Deadline assignment | Gives each request an expiry time | Prevents starvation |
| Anticipation or idling | Waits briefly for a nearby request | Preserves sequential patterns |
| Budget accounting | Tracks service per process or group | Fair bandwidth sharing |
Classic disk scheduling algorithms
Classic disk scheduling algorithms were developed for rotating disks, where seek time and rotational latency dominate service time. They remain the textbook foundation for understanding any I/O scheduler, even though modern kernels implement refined variants.
The algorithms differ mainly in how they balance total head movement against the risk that distant requests wait too long.
| Algorithm | Ordering rule | Strength | Weakness |
|---|---|---|---|
| FCFS | Arrival order | Simple and fair | Long seeks |
| SSTF | Nearest request first | Low average seek | Can starve far requests |
| SCAN (elevator) | Sweep in one direction, then reverse | Bounded waiting | Edges served less often |
| C-SCAN | Sweep one way, jump back | More uniform wait times | Return sweep is unused |
| LOOK and C-LOOK | Like SCAN, stop at last request | Avoids empty travel | Still position-driven |
These algorithms assume the scheduler knows the physical geometry of the disk. Modern drives hide geometry behind logical block addresses and reorder commands internally through Native Command Queuing, which limits how much the operating system can optimize.
I/O schedulers in modern kernels
Modern kernels ship several I/O schedulers that administrators can select per device. Linux moved to the multi-queue block layer (blk-mq), which maps per-CPU software queues to hardware queues and supports schedulers designed for devices that process many commands in parallel.
| Scheduler | Policy | Best suited to |
|---|---|---|
| none | Passes requests straight through | Fast NVMe devices |
| mq-deadline | Sorted queues with read and write deadlines | SATA SSDs and general servers |
| BFQ | Budget Fair Queueing per process | Desktops and slow media |
| Kyber | Token-based latency targets | Fast devices needing latency control |
Windows does not expose a selectable scheduler in the same way. Instead, its storage stack uses I/O priorities and bandwidth reservation, while the storport miniport driver and the device firmware handle ordering. In both systems, hardware queue depth strongly influences how much reordering is still useful.
Choosing an I/O scheduler for a device
Choosing an I/O scheduler depends mainly on the device type and the workload mix. On a device that services commands in tens of microseconds, scheduler overhead and lock contention can cost more than the scheduler saves, while a slow disk benefits greatly from merging and sorting.
The decision table below reflects common practice; measurements on the real workload should always confirm the choice.
| Situation | Recommended choice | Reason |
|---|---|---|
| NVMe database server | none | Device parallelism exceeds scheduler gains |
| SATA SSD in a server | mq-deadline | Low overhead with starvation protection |
| Desktop with hard disk | BFQ | Keeps applications responsive during copies |
| Mixed tenants on shared storage | BFQ or group throttling | Enforces fair bandwidth shares |
| Latency-sensitive fast storage | Kyber | Targets read and write latency |
Limitations and common mistakes
An I/O scheduler can only reorder what it sees, so its effect is limited by layers below and above it. Virtual machines, RAID controllers and storage arrays often reorder requests again, which can cancel or distort the policy chosen in the guest.
- Using a seek-optimizing scheduler on NVMe adds CPU overhead without reducing latency.
- Expecting the scheduler to fix a saturated device; no ordering policy can create bandwidth that the hardware lacks.
- Ignoring the page cache and writeback behavior, which often shapes I/O patterns more than the scheduler does.
- Tuning in a guest while the host scheduler makes the real decisions.
- Benchmarking with synthetic sequential loads when the production workload is random and mixed.
Because direct memory access and interrupt handling complete the transfer after dispatch, end-to-end latency also depends on the driver and interrupt path, not only on queue order.
Understanding it simply
Programs constantly ask the computer to read and save data on its drive. These requests arrive in a jumbled order. The I/O scheduler is the part of the system that puts the requests in a sensible order before the drive handles them.
Picture a delivery driver with twenty parcels. Driving to the addresses in the order the parcels arrived wastes time. Grouping nearby streets saves fuel, but no customer should wait all day. A good scheduler finds the balance between speed and fairness. Fast modern drives need less help, so the scheduler often steps back.
Applied in practice
A small company runs a file server with a large hard disk array that stores project archives, while staff also use it for shared documents. During nightly backups, opening a single document during working hours took several seconds, because long sequential backup reads filled the queue.
The administrator switches the disks from a simple pass-through policy to BFQ and assigns the backup job a low I/O priority. BFQ now gives each process a bandwidth budget, so short interactive reads are served between batches of backup requests instead of waiting behind them.
Document opening times drop to under half a second, while the backup finishes about 10 percent later. On the same server, the new NVMe cache drive keeps the none scheduler, because measurements show that any reordering only adds overhead on that device.