linux poison RSS
linux poison Email

Setting IO Scheduler for Maximum Performance on OpenSuSe Linux

Virtually all applications running on Linux do some sort of IO. Even surfing the web produces a great number of small files that are written to disk. Without an IO scheduler, every time there is an IO request, there is an interrupt to the kernel and the IO operation is performed. Perhaps more importantly, over time the disparity in the performance of disk drives and the rest of the system has grown very rapidly meaning that IO has become more important to overall system performance. As you can imagine when the kernel has to address the interrupt so any kind of processing or interactive work is paused. Consequently the system may appear unresponsive, or it may appear that the system has slowed down, hence the correct selection of the IO scheduler here becomes very important depending upon the type of workload you are doing - Normal desktop or proxy server or Database server or Web Server etc..

There are currently four IO schedulers in the Linux kernel.

Anticipatory IO Scheduler (AS)
The anticipatory scheduler is the default scheduler in older 2.6 kernels – if you've not specified one, this is the one that will be loaded. It implements request merging, a one-way elevator, read and write request batching, and attempts some anticipatory reads by holding off a bit after a read batch if it thinks a user is going to ask for more data. It tries to optimize for physical disks by avoiding head movements if possible – one downside to this is that it probably give highly erratic performance on database or storage systems.

Deadline Scheduler
The deadline scheduler implements request merging, a one-way elevator, and imposes a deadline on all operations to prevent resource starvation. Because writes return instantly within Linux, with the actual data being held in cache, the deadline scheduler will also prefer readers – as long as the deadline for a write request hasn't passed. 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.

Complete Fair Queuing Scheduler (CFQ)
The complete fair queuing scheduler implements both request merging and the elevator, and attempts to give all users (process) of a particular device the same number of IO requests over a particular time interval. This should make it more efficient for multiuser systems. As of the 2.6.18 kernel, this is the default scheduler in kernel.org releases.

What CFQ does, is to give all users (processes) of a particular device (storage) about the same number of IO requests over a particular time interval. This can help multi-user systems since all users will see about the same level of responsiveness. More over, CFQ achieves some of the good throughput characteristics of the anticipatory scheduler because it allows a process queue to have some idle time at the end of a synchronous IO request creating some anticipatory time waiting for some IO that might be close to the just finished request.

It should provide a fair working environment, suitable for desktop systems.

NOOP (No-Op)
The NOOP scheduler inserts all incoming I/O requests into a simple, unordered FIFO queue and implements request merging.

The scheduler assumes I/O performance optimization will be handled at some other layer of the I/O hierarchy; e.g., at the block device; by an intelligent HBA such as a Serial Attached SCSI (SAS) RAID controller or by an externally attached controller such as a storage subsystem accessed through a switched Storage Area Network)

NOOP scheduler is best used with solid state devices such as flash memory or in general with devices that do not depend on mechanical movement to access data (meaning typical "hard disk" drive technology consisting of seek time primarily, plus rotational latency). Such non-mechanical devices do not require re-ordering of multiple I/O requests, a technique that groups together I/O requests that are physically close together on the disk, thereby reducing average seek time and the variability of I/O service time."

Setting IO Scheduler on OpenSuSe System:
Go to Yast >> System >> Kernel Setting (open up Kernel Setting tab)
Here in the drop down you can select the type of  IO Scheduler you want for your system
For my Desktop system, I have selected CFQ




0 comments:

Post a Comment

Related Posts with Thumbnails