aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-06-24 19:03:14 +0200
committerGitHub <noreply@github.com>2020-06-24 19:03:14 +0200
commitf17a53f3c4a9ec59b58496312e1fe42f1ca17705 (patch)
tree74e6862b446daab5888616636d460428ca54bab7
parent78aa355c2adfbb407d33f28855899354b499ba38 (diff)
parent62005bca8c97182642405a28a30e6624be3201b8 (diff)
Merge pull request #13692 from vespa-engine/balder/do-not-cap-for-adaptive
With adadptive mode there is no need to cap number of threads
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/threading_service_config.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/threading_service_config.cpp b/searchcore/src/vespa/searchcore/proton/server/threading_service_config.cpp
index 22eb64acdee..cf9f27a94af 100644
--- a/searchcore/src/vespa/searchcore/proton/server/threading_service_config.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/threading_service_config.cpp
@@ -28,13 +28,17 @@ ThreadingServiceConfig::ThreadingServiceConfig(uint32_t indexingThreads_,
namespace {
uint32_t
-calculateIndexingThreads(uint32_t cfgIndexingThreads, double concurrency, const HwInfo::Cpu &cpuInfo)
+calculateIndexingThreads(const ProtonConfig::Indexing & indexing, double concurrency, const HwInfo::Cpu &cpuInfo)
{
- // We are capping at 12 threads to reduce cost of waking up threads
- // to achieve a better throughput.
- // TODO: Fix this in a simpler/better way.
- double scaledCores = std::min(12.0, cpuInfo.cores() * concurrency);
- uint32_t indexingThreads = std::max((uint32_t)std::ceil(scaledCores / 3), cfgIndexingThreads);
+ double scaledCores = cpuInfo.cores() * concurrency;
+ if (indexing.optimize != ProtonConfig::Indexing::Optimize::ADAPTIVE) {
+ // We are capping at 12 threads to reduce cost of waking up threads
+ // to achieve a better throughput.
+ // TODO: Fix this in a simpler/better way.
+ scaledCores = std::min(12.0, scaledCores);
+ }
+
+ uint32_t indexingThreads = std::max((int32_t)std::ceil(scaledCores / 3), indexing.threads);
return std::max(indexingThreads, 1u);
}
@@ -54,7 +58,7 @@ selectOptimization(ProtonConfig::Indexing::Optimize optimize) {
ThreadingServiceConfig
ThreadingServiceConfig::make(const ProtonConfig &cfg, double concurrency, const HwInfo::Cpu &cpuInfo)
{
- uint32_t indexingThreads = calculateIndexingThreads(cfg.indexing.threads, concurrency, cpuInfo);
+ uint32_t indexingThreads = calculateIndexingThreads(cfg.indexing, concurrency, cpuInfo);
return ThreadingServiceConfig(indexingThreads, cfg.indexing.tasklimit,
(cfg.indexing.semiunboundtasklimit / indexingThreads),
selectOptimization(cfg.indexing.optimize),