From cebc08cb78156a4b6065f3855a4c89fd61d8adb8 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Fri, 22 Dec 2023 10:57:03 +0800 Subject: [PATCH] nixos: zram-generator: use optimized sysctl --- nixos/profiles/opt-in/zram-generator.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nixos/profiles/opt-in/zram-generator.nix b/nixos/profiles/opt-in/zram-generator.nix index 7cd02e6..47bde06 100644 --- a/nixos/profiles/opt-in/zram-generator.nix +++ b/nixos/profiles/opt-in/zram-generator.nix @@ -6,4 +6,12 @@ _: { zram-size = "ram"; }; }; + + # https://wiki.archlinux.org/title/Zram#Optimizing_swap_on_zram + boot.kernel.sysctl = { + "vm.swappiness" = 180; + "vm.watermark_boost_factor" = 0; + "vm.watermark_scale_factor" = 125; + "vm.page-cluster" = 0; + }; }