In this era of multi-core, multi-gigaherz CPUs, traditional platter-based hard disks remain the “weak link” of modern machines. And they are here to stay: while SSDs are rapidly evolving and their prices are dropping, the cost per GB of storage space offered by HDDs is simply unmatched by their flash brothers.
The work of the I/O scheduler, a key component of every operating system, is precisely to extract as much juice as possible from these aging HDDs. Linux has not only one or two, but no less then four I/O schedulers at your disposition. Here is a brief explanation of these schedulers (taken from this Red Hat article):
- the Anticipatory scheduler introduces a controlled delay before dispatching the I/O to attempt to aggregate and/or re-order requests improving locality and reducing disk seek operations. This algorithm is intended to optimize systems with small or slow disk subsystems;
- the Completely Fair Queuing (CFQ) scheduler maintains a scalable per-process I/O queue and attempts to distribute the available I/O bandwidth equally among all I/O requests;
- the Deadline scheduler uses a deadline algorithm to minimize I/O latency for a given I/O request;
- the Noop scheduler is a simple FIFO queue, and it assumes performance of the I/O has been or will be optimized at the block device.