From 8139a079f80bdd78b5135d536b88b632c9eb51f3 Mon Sep 17 00:00:00 2001 From: Frederik Ramm Date: Wed, 20 Jun 2018 14:17:07 +0200 Subject: [PATCH] limit default threads to 15 When no explicit number of threads is given, don't simply use getProcessorCount()-1, but limit to max. 15 --- utils/setup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/setup.php b/utils/setup.php index 259ddf2d..a7f77e55 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -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");