4.2. The I/O Scheduler
Starting with the 2.6 kernel, for example Red Hat Enterprise Linux 4 or 5, the I/O scheduler can be changed at boot time which controls the way the kernel commits reads and writes to disks. For more information on various I/O scheduler, see Choosing an I/O Scheduler for Red Hat Enterprise Linux 4 and the 2.6 Kernel . Red Hat Enterprise Linux 5 allows users to change I/O schedulers dynamically, one way this can be done is by executing the command
echo sched_name > /sys/block/<sdx>/queue/scheduler.
The Completely Fair Queuing (CFQ) scheduler is the default algorithm in Red Hat Enterprise Linux 4 which is suitable for a wide variety of applications and provides a good compromise between throughput and latency. In comparison to the CFQ algorithm, the Deadline scheduler caps maximum latency per request and maintains a good disk throughput which is best for disk-intensive database applications. Hence, the Deadline scheduler is recommended for database systems. Also, at the time of this writing there is a bug in the CFQ scheduler which affects heavy I/O, see Metalink Bug:5041764. Even though this bug report talks about OCFS2 testing, this bug can also happen during heavy IO access to raw or block devices and as a consequence could evict RAC nodes.
To switch to the Deadline scheduler, the boot parameter
elevator=deadlinemust be passed to the kernel that is being used. Edit the
/etc/grub.conffile and add the following parameter to the kernel that is being used, in this example
title Red Hat Enterprise Linux Server (2.6.18-8.el5) root (hd0,0) kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/sda2 elevator=deadline initrd /initrd-2.6.18-8.el5.img
This entry tells the
2.6.18-8.el5kernel to use the Deadline scheduler. Make sure to reboot the system to activate the new scheduler.