limit default threads to 15

When no explicit number of threads is given, don't simply use getProcessorCount()-1, but limit to max. 15
This commit is contained in:
Frederik Ramm 2018-06-20 14:17:07 +02:00 committed by GitHub
parent 0d341c256b
commit 8139a079f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,8 +61,8 @@ if ($aCMDResult['import-data'] || $aCMDResult['all']) {
}
// This is a pretty hard core default - the number of processors in the box - 1
$iInstances = isset($aCMDResult['threads'])?$aCMDResult['threads']:(getProcessorCount()-1);
// by default, use all but one processor, but never more than 15.
$iInstances = isset($aCMDResult['threads'])?$aCMDResult['threads']:(min(16,getProcessorCount())-1);
if ($iInstances < 1) {
$iInstances = 1;
warn("resetting threads to $iInstances");