]> git.openstreetmap.org Git - nominatim.git/commitdiff
limit default threads to 15
authorFrederik Ramm <frederik@remote.org>
Wed, 20 Jun 2018 12:17:07 +0000 (14:17 +0200)
committerGitHub <noreply@github.com>
Wed, 20 Jun 2018 12:17:07 +0000 (14:17 +0200)
When no explicit number of threads is given, don't simply use getProcessorCount()-1, but limit to max. 15

utils/setup.php

index 259ddf2df139589b09efbd55ed4d12353b35c922..a7f77e557c823eb1a42aed0284827793f936543d 100755 (executable)
@@ -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");