Commit 57bbbb75 authored by Jessica Severin's avatar Jessica Severin
Browse files

Queen now uses avg_msec_per_job to guess how many workers are needed to

complete an analysis.  If no job has been run (0 msec) it will assume 1 job
per worker up to the hive_capacity (maximum parallization).
Also changed worker->process_id to be the pid of the process not the ppid.
parent 7005253a
......@@ -128,7 +128,7 @@ sub create_new_worker {
}
my $host = hostname;
$pid = getppid unless($pid);
$pid = $$ unless($pid);
$beekeeper = '' unless($beekeeper);
my $sql = q{INSERT INTO hive
......@@ -280,8 +280,9 @@ sub synchronize_AnalysisStats {
if($status eq 'READY') {
$analysisStats->unclaimed_job_count($count);
my $numWorkers = POSIX::ceil($count/$analysisStats->batch_size);
$numWorkers=1 if($numWorkers<1);
my $numWorkers = POSIX::ceil($count * $analysisStats->avg_msec_per_job / 300000);
# guess num needed workers by total jobs / (num jobs a worker could do in 5 minutes)
$numWorkers=$count if($numWorkers==0);
if($analysisStats->hive_capacity>0 and $numWorkers > $analysisStats->hive_capacity) {
$numWorkers=$analysisStats->hive_capacity;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment