Deadline scheduler

From Wikipedia, the free encyclopedia

Deadline scheduler is an I/O scheduler for the Linux kernel which was written by Jens Axboe.

Contents

[edit] Overview

The goal of the Deadline scheduler is to attempt to guarantee a start service time for a request[1]. It does that by imposing a deadline on all I/O operations to prevent resource starvation. It also maintains two deadline queues, in addition to the sorted queues (both read and write). Deadline queues are basically sorted by their deadline (the expiration time), while the sorted queues are sorted by the sector number.

Before serving the next request, the Deadline scheduler decides which queue to use. Read queues are given a higher priority, because processes usually block on read operations. Next, the Deadline scheduler checks if the first request in the deadline queue has expired. Otherwise, the scheduler serves a batch of requests from the sorted queue. In both cases, the scheduler also serves a batch of requests following the chosen request in the sorted queue.

By default, read requests have an expiration time of 500 ms, write requests expire in 5 seconds.

The kernel docs suggest this is the preferred scheduler for database systems, especially if you have TCQ aware disks, or any system with high disk performance[2].

[edit] Tuning

Each I/O queue has a set of I/O scheduler tunables associated with it. These tunables control how the I/O scheduler works. You can find these entries in:

/sys/block/<device>/queue/iosched

assuming that you have sysfs mounted on /sys. If you don't have sysfs mounted, you can do so by typing:

# mount none /sys -t sysfs

[edit] Other I/O schedulers

[edit] Sources

[edit] Notes and references

  1. ^ Jens Axboe, Deadline IO scheduler tunables, Nov 11, 2002
  2. ^ Linux IO Scheduler. Retrieved on 2007-08-10.


Languages