From 0ec55c7bd5465d93ed406aef3bf6c1d0bdb5e003 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 12 Jan 2021 17:02:27 +0100 Subject: bare-metal: set optimal IO scheduler per disk type --- system/settings/hardware/bare-metal.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'system') diff --git a/system/settings/hardware/bare-metal.nix b/system/settings/hardware/bare-metal.nix index 998001c0..130c2d21 100644 --- a/system/settings/hardware/bare-metal.nix +++ b/system/settings/hardware/bare-metal.nix @@ -9,6 +9,15 @@ 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"; -- cgit 1.4.1