[Nix] Limit nix-daemon CPU usage

This commit is contained in:
Antoine Viallon 2023-06-01 18:49:36 +02:00
parent d6227b0255
commit c449ec13c9
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -50,8 +50,8 @@ in
CPUSchedulingPolicy = "idle"; CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle"; IOSchedulingClass = "idle";
IOAccounting = true; IOAccounting = true;
IOWeight = 1024 / 10; IOWeight = 10;
CPUWeight = 1; CPUWeight = 10;
CPUQuota = (toString (generalCfg.cpu.threads * 80)) + "%"; CPUQuota = (toString (generalCfg.cpu.threads * 80)) + "%";
Type = mkOverride 20 "simple"; Type = mkOverride 20 "simple";
}; };
@ -70,9 +70,11 @@ in
serviceConfig = { serviceConfig = {
Nice = 19; Nice = 19;
CPUSchedulingPolicy = mkForce "batch"; CPUSchedulingPolicy = mkForce "batch";
CPUWeight = 1;
CPUQuota = (toString (generalCfg.cpu.threads * 80)) + "%";
IOSchedulingClass = mkForce "idle"; IOSchedulingClass = mkForce "idle";
IOAccounting = true; IOAccounting = true;
IOWeight = 1024 / 10; IOWeight = 1;
}; };
}; };