Unable to permanently switch default io scheduler from noop to deadline

Discussion in 'Proxmox VE: Installation and configuration' started by Flo, Jan 10, 2019.

  1. Flo

    Flo New Member
    Proxmox Subscriber

    Joined:
    May 31, 2010
    Messages:
    9
    Likes Received:
    0
    It seems that "noop" is the default io scheduler on most of our proxmox (5.3) hosts. But on the wiki it is to be read "Proxmox VE uses deadline by default". I wonder why it's not the case on our installations?

    Even if I try to set
    Code:
    GRUB_CMDLINE_LINUX_DEFAULT="nmi_watchdog=0 elevator=deadline"
    in /etc/default/grub followed by update-grub it is still "noop" after a reboot...

    Nevertheless it is possible to change the scheduler online:
    Code:
    root@fipm101:t# cat /sys/block/sda/queue/scheduler
    [noop] deadline cfq
    root@fipm101:# echo deadline > /sys/block/sda/queue/scheduler
    root@fipm101:# cat /sys/block/sda/queue/scheduler
    noop [deadline] cfq
    Any Ideas how to make this setting permanent?

    Thanks
     
  2. Alwin

    Alwin Proxmox Staff Member
    Staff Member

    Joined:
    Aug 1, 2017
    Messages:
    1,972
    Likes Received:
    168
    We switched the scheduler from 'noop' sometime in PVE 4. I replaced the line as it depends on the IO patterns and hardware that is used to determine the right scheduler.

    EDIT: usually the grub way works, depending if there isn't any udev, systemd or sysfsutils interfering.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #2 Alwin, Jan 11, 2019
    Last edited: Jan 11, 2019
  3. t.lamprecht

    t.lamprecht Proxmox Staff Member
    Staff Member

    Joined:
    Jul 28, 2015
    Messages:
    1,042
    Likes Received:
    114
    The disk probably just does not supports setting it to deadline at start? Because we even have deadline as our default scheduler set at kernel build time.
    Code:
    $ grep -P "DEFAULT_(DEADLINE|NOOP|CFQ)" /boot/config-4.15.18-9-pve
    CONFIG_DEFAULT_DEADLINE=y
    # CONFIG_DEFAULT_CFQ is not set
    # CONFIG_DEFAULT_NOOP is not set
    
    You can also check with:
    Code:
    dmesg |grep scheduler
    the default one is marked with, well, "default".

    Which model and type is sda? Do you have other disks? If yes, can you check if they work with deadline:
    Code:
    cat /sys/class/block/sd?/queue/scheduler
    Because my SSDs all do here.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Flo

    Flo New Member
    Proxmox Subscriber

    Joined:
    May 31, 2010
    Messages:
    9
    Likes Received:
    0
    I've both spinner and ssd... but all are set to noop

    Code:
    # uname -a
    Linux fipm101 4.15.18-9-pve #1 SMP PVE 4.15.18-30 (Thu, 15 Nov 2018 13:32:46 +0100) x86_64 GNU/Linux
    #
    # 
    # grep -P "DEFAULT_(DEADLINE|NOOP|CFQ)" /boot/config-4.15.18-9-pve
    CONFIG_DEFAULT_DEADLINE=y
    # CONFIG_DEFAULT_CFQ is not set
    # CONFIG_DEFAULT_NOOP is not set
    #
    # dmesg| grep scheduler
    [    0.953896] io scheduler noop registered
    [    0.953897] io scheduler deadline registered (default)
    [    0.953938] io scheduler cfq registered
    #
    # cat /sys/class/block/sd?/queue/scheduler
    [noop] deadline cfq
    [noop] deadline cfq
    [noop] deadline cfq
    [noop] deadline cfq
    [noop] deadline cfq
    [noop] deadline cfq
    #
    # cat /sys/class/block/sd?/device/model
    ST1000NM0033-9ZM
    ST1000NM0033-9ZM
    ST1000NM0033-9ZM
    ST1000NM0033-9ZM
    SAMSUNG MZ7KM240
    SAMSUNG MZ7KM240
    
    
    Also I can't find any reference to noop in udev rules..

    Code:
    #  rgrep -i noop /etc/udev/*
    So why is it?
     
  5. t.lamprecht

    t.lamprecht Proxmox Staff Member
    Staff Member

    Joined:
    Jul 28, 2015
    Messages:
    1,042
    Likes Received:
    114
    Hmm, weird.. To be honest, I need to investigate a bit...
    Until then you could try to tell udev to set the scheduler for you correctly as a workaround:

    Code:
    # cat /etc/udev/rules.d/42-io-sched.rules
    ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/scheduler}="deadline"
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. mailinglists

    mailinglists Active Member

    Joined:
    Mar 14, 2012
    Messages:
    346
    Likes Received:
    32
    This is my workaround for the same issue. Make sure rc.local is executable.
    Code:
    root@p26:~# cat /etc/rc.local
    #!/bin/sh -e
    echo deadline > /sys/block/sda/queue/scheduler
    echo deadline > /sys/block/sdb/queue/scheduler
    exit 0
    
     
  7. Flo

    Flo New Member
    Proxmox Subscriber

    Joined:
    May 31, 2010
    Messages:
    9
    Likes Received:
    0
    Yes, that's exactly what I've done... and it works as expected!

    Thanks
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice