epyc: nerf it

This commit is contained in:
raito 2023-08-13 01:21:32 +02:00
parent ada25e575f
commit 0e8785863e

View file

@ -1,6 +1,7 @@
{ lib { lib
, config , config
, pkgs , pkgs
, inputs
, ... , ...
}: }:
@ -29,6 +30,17 @@ in
{ domain = "*"; item = "nofile"; type = "-"; value = "20480"; } { domain = "*"; item = "nofile"; type = "-"; value = "20480"; }
]; ];
# Memory accounting techniques
systemd.services.nix-daemon.serviceConfig = {
MemoryAccounting = true;
MemoryMax = "225G";
MemoryHigh = "220G";
MemorySwapMax = "2G";
ManagedOOMSwap = "kill";
ManagedOOMMemoryPressure = "kill";
MemoryPressureWatch = "on";
};
nix = { nix = {
# Garbage-collect often # Garbage-collect often
gc.automatic = true; gc.automatic = true;
@ -38,23 +50,21 @@ in
# Randomize GC to avoid thundering herd effects. # Randomize GC to avoid thundering herd effects.
gc.randomizedDelaySec = "1800"; gc.randomizedDelaySec = "1800";
# 2.11, 2.12 suffers from a bug with remote builders… # Inchallah, it works.
package = pkgs.nixVersions.nix_2_13; # package = lib.mkForce inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.nixVersions.nix_2_17;
# should be enough? # should be enough?
nrBuildUsers = 128; nrBuildUsers = 128;
# https://github.com/NixOS/nix/issues/719
daemonCPUSchedPolicy = "batch";
daemonIOSchedClass = "best-effort";
daemonIOSchedPriority = 5;
settings = { settings = {
keep-outputs = true; keep-outputs = true;
keep-derivations = true; keep-derivations = true;
max-jobs = 42; # 64 is too much, it will explode the RAM for now. Let's keep it serious. use-cgroups = true;
# in zfs we trust http-connections = 0;
fsync-metadata = lib.boolToString (!config.boot.isContainer or config.fileSystems."/".fsType != "zfs"); auto-allocate-uids = true;
cores = 64; # 128 is too much, it will explode the RAM for now. Let's keep it serious.
max-jobs = 2; # Do not build more than 2 derivations at once in the event, both of them are too big, yes this is stupid, fix it in Nix.
fsync-metadata = true;
substituters = [ substituters = [
"https://nix-community.cachix.org" "https://nix-community.cachix.org"
"https://tum-dse.cachix.org" "https://tum-dse.cachix.org"
@ -64,6 +74,14 @@ in
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"tum-dse.cachix.org-1:v67rK18oLwgO0Z4b69l30SrV1yRtqxKpiHodG4YxhNM=" "tum-dse.cachix.org-1:v67rK18oLwgO0Z4b69l30SrV1yRtqxKpiHodG4YxhNM="
]; ];
experimental-features = [
"auto-allocate-uids"
"ca-derivations"
"cgroups"
"discard-references"
"fetch-closure"
"impure-derivations"
];
}; };
}; };