From 9da3430b8302f9d738b1d65f63f50aefcdc9a9ca Mon Sep 17 00:00:00 2001 From: Andre Date: Thu, 2 Jan 2025 14:01:16 -0500 Subject: [PATCH] Modules: set RAID optimizations --- modules/nixos/system/raid/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/nixos/system/raid/default.nix b/modules/nixos/system/raid/default.nix index 25a8cb7..2ebfdaf 100644 --- a/modules/nixos/system/raid/default.nix +++ b/modules/nixos/system/raid/default.nix @@ -49,6 +49,13 @@ in options = [ "nofail" ]; }; + # Optimize RAID performance via udev rules + # See https://serverfault.com/questions/579489/linux-what-is-stripe-cache-size-and-what-does-it-do + services.udev.extraRules = '' + SUBSYSTEM=="block", KERNEL=="md*", ACTION=="change", TEST=="md/stripe_cache_size", ATTR{md/stripe_cache_size}="8192" + SUBSYSTEM=="block", KERNEL=="md*", ACTION=="change", TEST=="queue/read_ahead_kb", ATTR{md/read_ahead_kb}="8192" + ''; + # Automatically scrub the array monthly systemd = { services."raid-scrub" = {