Skip to content

Commit

Permalink
mtr: update heuristics for --parallel=auto
Browse files Browse the repository at this point in the history
to work better for CPUs with more than 2000 bogomips.
old behavior is preserved if less than 2500 bogomips.
  • Loading branch information
vuvova committed Mar 14, 2020
1 parent 0fe3d6d commit 5c1ed70
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,8 @@ sub main {
if ( $opt_parallel eq "auto" ) {
# Try to find a suitable value for number of workers
my $sys_info= My::SysInfo->new();
$opt_parallel= $sys_info->num_cpus() + int($sys_info->min_bogomips()/500)-4;

$opt_parallel= $sys_info->num_cpus();
for my $limit (2000, 1500, 1000, 500){
$opt_parallel-- if ($sys_info->min_bogomips() < $limit);
}
my $max_par= $ENV{MTR_MAX_PARALLEL} || 8;
$opt_parallel= $max_par if ($opt_parallel > $max_par);
$opt_parallel= $num_tests if ($opt_parallel > $num_tests);
Expand Down

0 comments on commit 5c1ed70

Please sign in to comment.