X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/3fda7929294e6c7e59f75854d8ff372e22f0f4d2..7e0fdf5928a0c726b22ad969267a3b9e0402c823:/utils/setup.php?ds=sidebyside diff --git a/utils/setup.php b/utils/setup.php index 259ddf2d..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"); @@ -596,6 +599,7 @@ if ($aCMDResult['create-search-indices'] || $aCMDResult['all']) { $bDidSomething = true; $sTemplate = file_get_contents(CONST_BasePath.'/sql/indices.src.sql'); + $sTemplate = str_replace('{www-user}', CONST_Database_Web_User, $sTemplate); $sTemplate = replace_tablespace( '{ts:address-index}', CONST_Tablespace_Address_Index,