Unable to permanently switch default io scheduler from noop to deadline

Flo

Renowned Member
May 31, 2010
9
0
66
Freiburg
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
 
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.
 
Last edited:
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.
 
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?
 
So why is it?

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"
 
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
 
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"

Yes, that's exactly what I've done... and it works as expected!

Thanks
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!