bare-metal: set optimal IO scheduler per disk type
Alan Pearce alan@alanpearce.eu
Tue, 12 Jan 2021 17:02:27 +0100
1 files changed, 9 insertions(+), 0 deletions(-)
M system/settings/hardware/bare-metal.nix → system/settings/hardware/bare-metal.nix
@@ -9,6 +9,15 @@ pciutils usbutils ]; + services.udev.extraRules = '' + # set scheduler for NVMe + ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/scheduler}="none" + # set scheduler for SSD and eMMC + ACTION=="add|change", KERNEL=="sd[a-z]|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="mq-deadline" + # set scheduler for rotating disks + ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" + ''; + boot.kernel.sysctl = { "net.ipv4.tcp_allowed_congestion_control" = "illinois reno lp"; "net.ipv4.tcp_congestion_control" = "illinois";