diff --git a/hosts/FredOS-Eee.nix b/hosts/FredOS-Eee.nix index 1a1ec2b..67a60a8 100644 --- a/hosts/FredOS-Eee.nix +++ b/hosts/FredOS-Eee.nix @@ -101,8 +101,14 @@ in # 1GB RAM: compressed swap only (disk swap is off, see hardware file). zramSwap.enable = true; # A heavy page (bbc.co.uk) used to freeze everything; now the biggest - # process (the browser's web process) dies instead. + # process (the browser's web process) dies instead. zram lives in RAM, so + # swap never looks full: judge on RAM alone. services.earlyoom.enable = true; + services.earlyoom.freeSwapThreshold = 100; + # Even with no disk swap it still froze: the kernel kept evicting and + # re-reading program code from disk. MGLRU's min_ttl OOM-kills instead + # when it can't keep the last 1s of working set in RAM. + systemd.tmpfiles.rules = [ "w /sys/kernel/mm/lru_gen/min_ttl_ms - - - - 1000" ]; # The NixOS manual is a big from-source build on i686 for a page nobody reads. documentation.nixos.enable = false;