Sun, April 1, 2018 ยท 1 min read

Scheduling disk I/O on fedora 26

Scheduling disk I/O on fedora 26

By default on Linux machines CFQ I/O scheduler is used, Completely Fair Queuing (CFQ) is an I/O scheduler for the Linux kernel. CFQ scheduler is generally ideal and suitable for general system workloads.

If the server is used for virtualization like KVM, VMware it needs to have optimized throughput. For this we can use deadline I/O scheduler to achieve maximum performance.

KVM guests often benefit greatly from the noop I/O scheduler, which allows the host/hypervisor to optimize the I/O requests.

Check current I/O scheduler

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

Change scheduler

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

Make persistent via GRUB

Edit /etc/default/grub and add elevator=deadline:

GRUB_CMDLINE_LINUX="rhgb quiet video=SVIDEO-1:d console=tty0 console=ttyS0,115200n8 elevator=deadline"

Rebuild grub2:

$ grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found background: /boot/grub2/themes/linux.jpg
Found linux image: /boot/vmlinuz-4.15.12-201.fc26.x86_64
Found initrd image: /boot/initramfs-4.15.12-201.fc26.x86_64.img
done

Check IO scheduler status:

$ grep -vH "zzz" /sys/block/sda/queue/iosched/*