Saturday, June 14, 2014

Changing I/O Scheduler for HDD

If you are using SSD disk or you are running system from SD Card, it's a good practice to change kernel I/O schedulers for your HDD/Storage, to get better performance and better lifetime.


I'll start with a link on archlinux wiki, where you can view entire documentation for cfq scheduler.
In linux you have available 3 types of schedulers:
  • deadline
  • noop
  • cfq
By default you should have cfq used either for rotational and non-rotational disks. It is probably the best option, as at this time cfq has been also optimized for SSD hard disks.

You can view your schedulers with following command (e.g. for sda device):
cat /sys/block/sda/queue/scheduler
On Raspberry PI, default scheduler in use is noop. This was probably due to low CPU exhausting and usage of SD card for the OS.

On odroid was the default scheduler cfq. With this scheduler in use, I've experienced system freezing, so I've changed it to noop like on Raspberry.
echo "noop" > /sys/block/mmcblk0/queue/scheduler
So far without any system freezing...

To make this changes permanent, I've created an udev rule /etc/udev/rules.d/60-schedulers.rules:
ACTION=="add|change", KERNEL=="mmcblk0", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="noop"

No comments:

Post a Comment