6.3. I/O Schedulers

Scheduling algorithms, sometimes referred to as elevators[47], are methods used by the operating system to decide the order in which block I/O operations (read/write) take place. Different algorithms exist because no single one is best suited for all workloads.

A database server would want to prioritize latency over throughput, thus making the deadline scheduler an ideal choice, whereas in an interactive desktop you would favor the CFQ (completely fair queueing) scheduler. Workload isn't the only parameter to consider when selecting a scheduler. The properties of the backing storage device also play an important role (SSD or spinning disk?). In a virtualized environment the choice of scheduler becomes even more involved because you may wish to consider the scheduler used by the hypervisor as well.

As you can see, the topic of selecting the proper I/O scheduler is neither short, nor is it simple. That being said, in this chapter I'll attempt to provide you with sufficient information to make an informed decision as well as several resources which discuss I/O schedulers in greater detail. Together we'll review the scheduler options available, the procedure for setting one permanently, and typical use cases.

6.3.1. Scheduler Options

In Linux you have three main scheduler options available.

6.3.2. CFQ

6.3.3. Deadline

6.3.4. NOOP

6.3.5. Backing Storage

6.3.6. Additional Resources

White papers:

Performance tests:



[47] TODO: Explain why