X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ec6a427e0a7272445c992f6f046ae8cb5f5a534d..6a0d00faf06b4726286bbfcb216c382ca2e23bd0:/utils/setup.php?ds=inline diff --git a/utils/setup.php b/utils/setup.php index 4925a4e5..501ad3f2 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -61,8 +61,11 @@ 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");