summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2017-10-11 12:41:11 +0000
committerGeir Storli <geirst@oath.com>2017-10-11 12:41:11 +0000
commit0d30571f227704ae5ffee683f0402c7852f85fb4 (patch)
tree742f2f390c22691cf9445c099b41f3547dd99054 /searchcore
parentc23ad27a8c6fe1d8c868f71c069322e44d0cffc6 (diff)
Derive compression/compaction threads based on cpu cores and feeding concurrency.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
index 556743ad267..36f19c385f7 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
@@ -85,12 +85,10 @@ diskMemUsageSamplerConfig(const ProtonConfig &proton, const HwInfo &hwInfo)
}
size_t
-deriveBackgroundThreads(const ProtonConfig & proton) {
- size_t threads = std::thread::hardware_concurrency();
- if (proton.background.threads != 0) {
- threads = proton.background.threads;
- }
- threads = std::max(threads, size_t(proton.summary.log.numthreads));
+deriveCompactionCompressionThreads(const ProtonConfig &proton,
+ const HwInfo::Cpu &cpuInfo) {
+ size_t scaledCores = (size_t)std::ceil(cpuInfo.cores() * proton.feeding.concurrency);
+ size_t threads = std::max(scaledCores, size_t(proton.summary.log.numthreads));
// We need at least 1 guaranteed free worker in order to ensure progress so #documentsdbs + 1 should suffice,
// but we will not be cheap and give #documentsdbs * 2
@@ -302,7 +300,7 @@ Proton::init(const BootstrapConfig::SP & configSnapshot)
vespalib::string fileConfigId;
_warmupExecutor.reset(new vespalib::ThreadStackExecutor(4, 128*1024));
- const size_t summaryThreads = deriveBackgroundThreads(protonConfig);
+ const size_t summaryThreads = deriveCompactionCompressionThreads(protonConfig, _hwInfo.cpu());
_summaryExecutor.reset(new vespalib::BlockingThreadStackExecutor(summaryThreads, 128*1024, summaryThreads*16));
InitializeThreads initializeThreads;
if (protonConfig.initialize.threads > 0) {