Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


change_i_o_scheduler_elevator

This is an old revision of the document!


Change I/O scheduler

Do you need to change the scheduler?

CFQ is the default scheduler. If you have a specific use case, then you should benchmark the different schedulers. Quote: https://www.kernel.org/doc/Documentation/block/cfq-iosched.txt

CFQ has some optimizations for SSDs and if it detects a non-rotational
media which can support higher queue depth (multiple requests at in
flight at a time), then it cuts down on idling of individual queues and
all the queues move to sync-noidle tree and only tree idle remains. This
tree idling provides isolation with buffered write queues on async tree.

Current scheduler

Check current scheduler setting for sda:

$ cat /sys/block/sda/queue/scheduler
[noop] deadline cfq

Change scheduler

Temporary
echo "noop" > /sys/block/sda/queue/scheduler
For all disks

Add to the kernel line in /etc/grub.conf

elevator=noop
For specific SSD's using udev

Using udev:

/etc/udev/rules.d/60-schedulers.rules

# set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", TEST!="queue/rotational", ATTR{queue/scheduler}="deadline"
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"

# set cfq scheduler for rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"
change_i_o_scheduler_elevator.1400745878.txt.gz · Last modified: 2014/05/22 08:04 by admin