Product SiteDocumentation Site

4. Selecting a Scheduler

To specify a scheduler to be selected at boot time, add the following directive to the kernel line in /boot/grub/grub.conf:
elevator=<elevator type>
For example, to specify that the noop scheduler should be selected at boot time, use:
elevator=noop
You can also select a scheduler during runtime. To do so, use this command:
echo <elevator type> > /sys/block/<device>/queue/scheduler
For example, to set the noop scheduler to be used on hda, use:
echo noop > /sys/block/hda/queue/scheduler
At any given time, you can view /sys/block/<device>/queue/scheduler (using cat, for example) to verify which scheduler is being used by <device>. For example, if hda is using the noop scheduler, then cat /sys/block/hda/queue/scheduler should return:
[noop] anticipatory deadline cfq
Note that selecting a scheduler in this manner is not persistent throughout system reboots. Unlike the /proc/sys/ file system, the /sys/ file system does not have a utility similar to sysctl that can make such changes persistent throughout system reboots.
To make your scheduler selection persistent throughout system reboots, edit /boot/grub/grub.conf accordingly. Do this by appending elevator=<scheduler> to the the kernel line. <scheduler> can be either noop, cfq, as (for anticipatory), or deadline.
For example, to ensure that the system selects the noop scheduler at boot-time:
title Red Hat Enterprise Linux Server (2.6.18-32.el5)
	root (hd0,4)
	kernel /boot/vmlinuz-2.6.18-32.el5 ro root=LABEL=/1 rhgb quiet elevator=noop
	initrd /boot/initrd-2.6.18-32.el5.img