From f6f5d0414ed6955790d20d3152993ea7b2b73336 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 15 Oct 2009 11:25:15 +0000 Subject: [PATCH] * Run the nix-daemon with a lower I/O priority so that it doesn't interfere with interactive tasks as much (hopefully). svn path=/nixos/trunk/; revision=17820 --- modules/services/misc/nix-daemon.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/services/misc/nix-daemon.nix b/modules/services/misc/nix-daemon.nix index d1eee1576b6..69a7149c2be 100644 --- a/modules/services/misc/nix-daemon.nix +++ b/modules/services/misc/nix-daemon.nix @@ -67,13 +67,21 @@ in }; daemonNiceLevel = mkOption { - default = 2; + default = 10; description = " Nix daemon process priority. This priority propagates to build processes. 0 is the default Unix process priority, 20 is the lowest. "; }; + daemonIONiceLevel = mkOption { + default = 7; + description = " + Nix daemon process I/O priority. This priority propagates to build processes. + 0 is the default Unix process I/O priority, 7 is the lowest. + "; + }; + buildMachines = mkOption { example = [ { hostName = "voila.labs.cs.uu.nl"; @@ -197,7 +205,10 @@ in '' export PATH=${if config.nix.distributedBuilds then "${pkgs.openssh}/bin:${pkgs.gzip}/bin:" else ""}${pkgs.openssl}/bin:${nix}/bin:$PATH ${config.nix.envVars} - exec nice -n ${builtins.toString config.nix.daemonNiceLevel} ${nix}/bin/nix-worker --daemon > /dev/null 2>&1 + exec \ + nice -n ${builtins.toString config.nix.daemonNiceLevel} \ + ${pkgs.utillinux}/bin/ionice -n ${builtins.toString config.nix.daemonIONiceLevel} \ + ${nix}/bin/nix-worker --daemon > /dev/null 2>&1 ''; extraConfig =