unbound: calculation is still suboptimal #3092

On the far side of the interval up to the next power of two
the lock contention increases drastically, meaning 31 threads
will only get 32 slabs etc.
This commit is contained in:
Franco Fichtner 2019-01-03 13:06:48 +00:00
parent c6de22b584
commit 0c751d732a

View File

@ -86,7 +86,7 @@ function unbound_optimization()
$numprocs = intval(get_single_sysctl('kern.smp.cpus'));
$numprocs = $numprocs <= 0 ? 1 : $numprocs;
$numslabs = pow(2, ceil(log($numprocs, 2)));
$numslabs = pow(2, floor(log($numprocs, 2)) + 1);
$optimization['number_threads'] = "num-threads: {$numprocs}";
$optimization['msg_cache_slabs'] = "msg-cache-slabs: {$numslabs}";