Commit 5c1ed707 authored by Sergei Golubchik's avatar Sergei Golubchik

mtr: update heuristics for --parallel=auto

to work better for CPUs with more than 2000 bogomips.
old behavior is preserved if less than 2500 bogomips.
parent 0fe3d6d5
...@@ -441,11 +441,8 @@ sub main { ...@@ -441,11 +441,8 @@ sub main {
if ( $opt_parallel eq "auto" ) { if ( $opt_parallel eq "auto" ) {
# Try to find a suitable value for number of workers # Try to find a suitable value for number of workers
my $sys_info= My::SysInfo->new(); 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; my $max_par= $ENV{MTR_MAX_PARALLEL} || 8;
$opt_parallel= $max_par if ($opt_parallel > $max_par); $opt_parallel= $max_par if ($opt_parallel > $max_par);
$opt_parallel= $num_tests if ($opt_parallel > $num_tests); $opt_parallel= $num_tests if ($opt_parallel > $num_tests);
......
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