Changing linux I/O scheduler for VMware guest

  • Hi,


    Following VMware recommendations on how to change linux I/O scheduler for guests, I'm trying to do it on my OMV VM machine running Debian Wheezy.


    First, lets check which I/O scheduler is configured:

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


    As we can see above for device /dev/sda, the CFQ (Completely Fair Queueing) is the default scheduler that's being used, the one selected in brackets. Since the recommendation for VMware Virtual Machines is to change the scheduler to "noop" (as the hypervisor has its I/O scheduler), we can change it on the fly:

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


    This change is only temporary and will reset back to the default scheduler, CFQ in this case, when the machine reboots. To make the setting permanently, I've tried to change the grub configuration file by editing /etc/default/grub and add "elevator=noop" setting to GRUB_CMDLINE_LINUX_DEFAULT parameter, like below :


    I could check that the new setting was added to /boot/grub/grub.cfg:

    Code
    $ grep noop /boot/grub/grub.cfg
            linux   /boot/vmlinuz-3.16.0-0.bpo.4-amd64 root=UUID=1b9bcd41-d527-487d-ac30-3820137d8eea ro  elevator=noop quiet
            linux   /boot/vmlinuz-3.2.0-4-amd64 root=UUID=1b9bcd41-d527-487d-ac30-3820137d8eea ro  elevator=noop quiet


    The problem is that after system restart, the CFQ I/O scheduler is still active for /dev/sda:

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


    I've done the same configuration on Ubuntu Server 14.04 and CentOS 7 and everything worked fine after boot.
    Am I missing something?


    Thanks.

    OpenMediaVault 2.2.14 (Stone burner)
    VMware ESXi 5.5U3 (build-5230635) | HP ProLiant MicroServer Gen8 | Intel Xeon CPU E3-1265L V2 @ 2.50GHz | 16GB RAM | 250GB SSD + 4x 3TB HDD

  • Hi,


    Yes, I've run update-grub2 (which is a soft link to update-grub) as stated in my post.
    I know I can get a workaround to change the I/O scheduler, but I want to understand why changing grub did not worked out.


    Thx.

    OpenMediaVault 2.2.14 (Stone burner)
    VMware ESXi 5.5U3 (build-5230635) | HP ProLiant MicroServer Gen8 | Intel Xeon CPU E3-1265L V2 @ 2.50GHz | 16GB RAM | 250GB SSD + 4x 3TB HDD

  • My bad, overlooked it.
    Everything looks correct to me.
    I don't think OMV is changing the default schedular during/after boot, but i could be wrong.
    Maybe you should ask in the debian forums. That is what i would do.

  • Hi,


    I think I've found why editing grub default did not worked. It seems that OMV has placed a file in /etc/udev/rules.d called 99-openmediavault-scheduler.rules


    Code
    $ cat /etc/udev/rules.d/99-openmediavault-scheduler.rules
    
    
    # Set 'cfq' scheduler for rotating devices.
    SUBSYSTEM=="block", KERNEL=="[sh]d[a-z]", ACTION=="add|change", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"
    
    
    # Set 'deadline' scheduler for non-rotating devices.
    SUBSYSTEM=="block", KERNEL=="[sh]d[a-z]", ACTION=="add|change", TEST!="queue/rotational", ATTR{queue/scheduler}="deadline"
    SUBSYSTEM=="block", KERNEL=="[sh]d[a-z]", ACTION=="add|change", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"


    As we can see above, this udev rule is forcing all detected HDD with rotational=1 (either hdX or sdX) to change the scheduler to "cfq". Since VMDK disks on VMware are detected as rotational disks, my edit on grub was being overwritten by this udev rule.


    In OMV, to change the I/O scheduler permanently for virtual disks , we only need to edit this rule and change the scheduler to "noop", like this:

    Code
    $ vi /etc/udev/rules.d/99-openmediavault-scheduler.rules
    SUBSYSTEM=="block", KERNEL=="[sh]d[a-z]", ACTION=="add|change", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="noop"


    After boot, scheduler was changed like I wanted to.


    Hope this will help other users.


    Thx

    OpenMediaVault 2.2.14 (Stone burner)
    VMware ESXi 5.5U3 (build-5230635) | HP ProLiant MicroServer Gen8 | Intel Xeon CPU E3-1265L V2 @ 2.50GHz | 16GB RAM | 250GB SSD + 4x 3TB HDD

    • Offizieller Beitrag

    I run a lot of OMV VMs in VMs and have never changed the scheduler. I realize it may be a VMware recommendation but I don't think it is necessary.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!