summaryrefslogtreecommitdiff
path: root/lib/task.rb
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2011-01-10 17:47:09 +0100
committermr <mr@mrautenberg.de>2011-01-10 17:47:09 +0100
commitecdd0347a347bd2ac5fa9e6a41ec7475b007309d (patch)
tree72c7f34a8067d4d394760bf01e32e63b49a47284 /lib/task.rb
parenta65f376df49f215dea007f08362c2f15cf559a2c (diff)
A&A extent
Diffstat (limited to 'lib/task.rb')
-rw-r--r--lib/task.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/task.rb b/lib/task.rb
index 18fba6e..9cf909f 100644
--- a/lib/task.rb
+++ b/lib/task.rb
@@ -50,12 +50,12 @@ module OpenTox
cpu_load = `cat /proc/loadavg`.split(/\s+/)[0..2].collect{|c| c.to_f}
nr_cpu_cores = `cat /proc/cpuinfo |grep "cpu cores"|cut -d ":" -f2|tr -d " "`.split("\n").collect{|c| c.to_i}.inject{|sum,n| sum+n}
nr_cpu_cores = 1 if !nr_cpu_cores
- if cpu_load[0] > nr_cpu_cores and cpu_load[0] > cpu_load[1] and cpu_load[1] > cpu_load[2] # average CPU load of the last minute is high and CPU load is increasing
- LOGGER.warn "Cannot start task - CPU load too high (#{cpu_load.join(", ")})"
- task.cancel
- return task
- #raise "Server too busy to start a new task"
- end
+ #if cpu_load[0] > nr_cpu_cores and cpu_load[0] > cpu_load[1] and cpu_load[1] > cpu_load[2] # average CPU load of the last minute is high and CPU load is increasing
+ # LOGGER.warn "Cannot start task - CPU load too high (#{cpu_load.join(", ")})"
+ # task.cancel
+ # return task
+ # #raise "Server too busy to start a new task"
+ #end
task_pid = Spork.spork(:logger => LOGGER) do