Mediaserver: oomd backstop, 1G min_free, tighter nix cap

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-09-27 08:30:05 +01:00
parent d2a4e5cebe
commit c39d570d19

View file

@ -13,11 +13,20 @@
nix.settings.cores = 8;
nix.daemonCPUSchedPolicy = "batch";
systemd.services.nix-daemon.serviceConfig = {
MemoryHigh = "12G";
MemoryMax = "16G";
MemoryHigh = "8G";
MemoryMax = "10G";
OOMPolicy = "continue"; # a killed build shouldn't stop the daemon
};
# System-wide backstop for whatever else runs away. oomd was running but
# monitoring nothing; now it kills the worst cgroup once memory stalls
# hit 80% for 30s (start of a thrash, not 10h in).
systemd.oomd.enableRootSlice = true;
systemd.oomd.enableSystemSlice = true;
# Keep 1G truly free (default ~88M) so kernel networking and the watchdog
# can still allocate while userspace is squeezed.
boot.kernel.sysctl."vm.min_free_kbytes" = 1048576;
# Basic system packages
environment.systemPackages = with pkgs; [
mergerfs