From c9d3c348643e8cf7f7db2b5ff3e83591cdbea539 Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Sun, 27 Oct 2024 11:45:33 +0100 Subject: [PATCH] random swap related changes without thinking --- nixos/configuration.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 1f087e2..44d427c 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -96,6 +96,9 @@ in boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; "net.ipv6.conf.all.forwarding" = 1; + # 100 seems to be a good value for SSDs https://chrisdown.name/2018/01/02/in-defence-of-swap.html, + # as anon and file pages are equally expensive so 100 balances them out. + "vm.swappiness" = 100; }; boot.supportedFilesystems = [ "ntfs" ]; @@ -166,8 +169,8 @@ in services.earlyoom = { enable = true; enableNotifications = true; - # as soon as it starts swapping its SO over - freeSwapThreshold = 100; + # as soon as it starts swapping its SO over (hm) + freeSwapThreshold = 90; }; # Shows notification for `net.nuetzlich.SystemNotifications.Notify` D-Bus messages