From c449ec13c9d9eee66bc1ca1198f0e0eb721edf74 Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Thu, 1 Jun 2023 18:49:36 +0200 Subject: [PATCH] [Nix] Limit nix-daemon CPU usage --- nix/nix.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nix/nix.nix b/nix/nix.nix index c497bb7..c6496cc 100644 --- a/nix/nix.nix +++ b/nix/nix.nix @@ -50,8 +50,8 @@ in CPUSchedulingPolicy = "idle"; IOSchedulingClass = "idle"; IOAccounting = true; - IOWeight = 1024 / 10; - CPUWeight = 1; + IOWeight = 10; + CPUWeight = 10; CPUQuota = (toString (generalCfg.cpu.threads * 80)) + "%"; Type = mkOverride 20 "simple"; }; @@ -70,9 +70,11 @@ in serviceConfig = { Nice = 19; CPUSchedulingPolicy = mkForce "batch"; + CPUWeight = 1; + CPUQuota = (toString (generalCfg.cpu.threads * 80)) + "%"; IOSchedulingClass = mkForce "idle"; IOAccounting = true; - IOWeight = 1024 / 10; + IOWeight = 1; }; };