From 59ed12e645ab56d5b75941f4afb96ab4b9449f2c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Kr=C3=BCger?= Date: Fri, 19 Nov 2010 17:03:18 +0100 Subject: [PATCH] jobd: outsource limit for resource-hungry jobs to switch MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Make the limit for maximum simultaneous resource-hungry jobs (gc jobs) a command line switch and reduce the default value to a more reasonable 1, since some repositories can eat quite a bit of CPU and I/O indeed. Signed-off-by: Jan Krüger --- jobd/jobd.pl | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/jobd/jobd.pl b/jobd/jobd.pl index 77c2757..29d6f9c 100755 --- a/jobd/jobd.pl +++ b/jobd/jobd.pl @@ -20,7 +20,7 @@ my $quiet; my $progress; my $kill_after = 900; my $max_par = 20; -my $max_par_intensive = 3; # no command line option right now +my $max_par_intensive = 1; my $lockfile = "/tmp/jobd.lock"; my $all_once; my $one; @@ -316,6 +316,7 @@ my $parse_res = GetOptions( 'progress|P' => \$progress, 'kill-after|k=i' => \$kill_after, 'max-parallel|p=i' => \$max_par, + 'max-intensive-parallel|i=i' => \$max_par_intensive, 'lockfile|l=s' => \$lockfile, 'all-once|a' => \$all_once, 'one|o=s' => \$one, @@ -355,14 +356,17 @@ jobd - Perform Girocco maintenance jobs jobd [options] Options: - -h | --help detailed instructions - -q | --quiet run quietly - -P | --progress show occasional status updates - -k SECONDS | --kill-after=SECONDS how long to wait before killing jobs - -p NUM | --max-parallel=NUM how many jobs to run at the same time - -l FILE | --lockfile=FILE create a lockfile in the given location - -a | --all-once process the list only once - -o PRJNAME | --one=PRJNAME process only one project + -h | --help detailed instructions + -q | --quiet run quietly + -P | --progress show occasional status updates + -k SECONDS | --kill-after=SECONDS how long to wait before killing jobs + -p NUM | --max-parallel=NUM how many jobs to run at the same time + -i NUM | --max-intensive-parallel=NUM how many resource-hungry jobs to run + at the same time + -l FILE | --lockfile=FILE create a lockfile in the given + location + -a | --all-once process the list only once + -o PRJNAME | --one=PRJNAME process only one project =head1 OPTIONS @@ -389,6 +393,11 @@ Kill supervised jobs after a certain time to avoid hanging the daemon. Run no more than that many jobs at the same time. +=item B<--max-intensive-parallel=NUM> + +Run no more than that many resource-hungry jobs at the same time. Right now, +this refers to repacking jobs. + =item B<--lockfile=FILE> For perpetual operation, create a lockfile in that place and clean it up after -- 2.11.4.GIT