@cryptotaxi247 / infra-1 / commits / 121f6927

* Use cgroups to (hopefully) improve the interactiveness of the Hydra web server (by giving its processes a bigger CPU share than the build/evaluator processes).

* Use cgroups to (hopefully) improve the interactiveness of the Hydra web server (by giving its processes a bigger CPU share than the build/evaluator processes). svn path=/configurations/trunk/tud/; revision=30557

Eelco Dolstra committed Nov 25, 2011 at 12:58 UTC 121f69275c47b82c429e32c0d6441e39a4539dcc
2 files changed +36 -3
hydra-module.nix
+3 -3
@@ -146,7 +146,7 @@ in
146 { name = "hydra-server";
147 startOn = "started network-interfaces and started hydra-init";
148 exec = ''
149 - ${pkgs.su}/bin/su - ${cfg.user} -c '${server_env} hydra_server.pl -h \* --max_spare_servers 20 --max_servers 50 > ${cfg.baseDir}/data/server.log 2>&1'
149 + ${pkgs.su}/bin/su - ${cfg.user} -c '${server_env} exec hydra_server.pl -h \* --max_spare_servers 20 --max_servers 50 > ${cfg.baseDir}/data/server.log 2>&1'
150 '';
151 };
152
@@ -155,7 +155,7 @@ in
155 startOn = "started network-interfaces and started hydra-init";
156 preStart = "${pkgs.su}/bin/su - ${cfg.user} -c 'hydra_queue_runner.pl --unlock'";
157 exec = ''
158 - ${pkgs.su}/bin/su - ${cfg.user} -c 'nice -n 8 hydra_queue_runner.pl > ${cfg.baseDir}/data/queue_runner.log 2>&1'
158 + ${pkgs.su}/bin/su - ${cfg.user} -c 'exec hydra_queue_runner.pl > ${cfg.baseDir}/data/queue_runner.log 2>&1'
159 '';
160 };
161
@@ -163,7 +163,7 @@ in
163 { name = "hydra-evaluator";
164 startOn = "started network-interfaces";
165 exec = ''
166 - ${pkgs.su}/bin/su - ${cfg.user} -c '${env} nice -n 5 hydra_evaluator.pl > ${cfg.baseDir}/data/evaluator.log 2>&1'
166 + ${pkgs.su}/bin/su - ${cfg.user} -c '${env} exec hydra_evaluator.pl > ${cfg.baseDir}/data/evaluator.log 2>&1'
167 '';
168 };
169
lucifer.nix
+33
@@ -76,4 +76,37 @@
76 services.cron.systemCronJobs =
77 [ "*/5 * * * * hydra-mirror flock -x /data/releases/.lock -c /home/hydra-mirror/release/mirror/mirror-nixos-isos.sh >> /home/hydra-mirror/nixos-mirror.log 2>&1" ];
78
79 + services.cgroups = {
80 + enable = true;
81 + groups =
82 + ''
83 + mount {
84 + cpu = /dev/cgroup/cpu;
85 + }
86 + group hydra-server {
87 + cpu {
88 + cpu.shares = "700";
89 + }
90 + }
91 + group hydra-build {
92 + cpu {
93 + cpu.shares = "200";
94 + }
95 + }
96 + group hydra-evaluator {
97 + cpu {
98 + cpu.shares = "100";
99 + }
100 + }
101 + '';
102 + rules =
103 + ''
104 + root:nix-worker cpu hydra-build
105 + hydra:nix-store cpu hydra-build
106 + hydra:.hydra_build.pl-wrapped cpu hydra-build
107 + hydra:.hydra_evaluator.pl-wrapped cpu hydra-evaluator
108 + hydra:.hydra_server.pl-wrapped cpu hydra-server
109 + '';
110 + };
111 +
112 }