Linux disk performance on Hyper-V

To be honest… this blog post came up as I read another blog article a couple of days ago.
I refer to Ben Armstrong, Hyper-V Program Manager and his blog entry

“How to get the best disk performance with Linux on Hyper-V”.

 


Some of you might know about the I/O scheduler and handling block devices within the Linux world because the basic stuff came up when the first consumer SSDs were cheap enough to become significant spread.
Optimizing SSDs with trim, change caching and queuing via CFS/CFQ aka Completely Fair Scheduler and the “completely fair queue” were pretty usual.

Ubuntu 12.04 LTS came with [cfq] per default but following versions changed that to [deadline] which is the default installation on HDD since then.
You can check that easily with cat /sys/block/sda/queue/scheduler.
The result on Ubuntu 14.04 LTS is – noop [deadline] cfq – so deadline will be used.

If you install Ubuntu on a system driven by SSD the installer will change it automatically to noop.
Unfortunately per default Ubuntu won’t recognize what fit’s best on a Hyper-V environment and set the schedule option to the default (HDD) optimized deadline.
Not the best idea and hopefully it will be changed in future releases.

There are different ways to change that but I’m doing it via editing grub config.
Go to your Linux installation and do the following:

type the command

sudo nano /etc/default/grub and edit the Line

GRUB_CMDLINE_LINUX="" to GRUB_CMDLINE_LINUX="elevator=noop"

quit editing with ctrl & x – y for yes and update grub with sudo update-grub -> reboot the system.
Another run of cat /sys/block/sda/queue/scheduler should give you [noop] as default.

Btw.

I’m wrote that about Ubuntu 14.04 LTS but the basics should be the same with RHEL/CentOS,Oracle Linux, SLES and Debian which are the other official Linux distributions on Hyper-V.

rub