diff --git a/machines/Home-Hypervisor/boot.nix b/machines/Home-Hypervisor/boot.nix index 1b05ee9..b159700 100644 --- a/machines/Home-Hypervisor/boot.nix +++ b/machines/Home-Hypervisor/boot.nix @@ -78,7 +78,11 @@ in { "rd.udev.log_priority=3" ]; kernel.sysctl = { - "vm.swappiness" = if config.deviceSpecific.isSSD then 1 else 10; + "vm.swappiness" = 80; + "vm.vfs_cache_pressure" = 200; + "vm.dirty_background_ratio" = 1; + "vm.dirty_ratio" = 40; + "vm.page-cluster" = 0; }; # cleanTmpDir = true; }; diff --git a/profiles/boot.nix b/profiles/boot.nix index 7619ce7..aa5c77f 100644 --- a/profiles/boot.nix +++ b/profiles/boot.nix @@ -48,7 +48,13 @@ with config.deviceSpecific; { kernelPackages = lib.mkDefault pkgs.linuxPackages_lqx; consoleLogLevel = 3; - kernel.sysctl = { + kernel.sysctl = if config.zramSwap.enable then { + "vm.swappiness" = 100; + "vm.vfs_cache_pressure" = 500; + "vm.dirty_background_ratio" = 1; + "vm.dirty_ratio" = 50; + "vm.page-cluster" = 0; + } else { "vm.swappiness" = if config.deviceSpecific.isSSD then 1 else 10; };