diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-02-24 14:57:47 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-02-24 14:57:47 +0000 |
commit | b1f88c1b2e948598edd083dd200fdcfad8c86c26 (patch) | |
tree | 619a8d8d66684382c2abe2c07720059a3b67fe8a /searchcore | |
parent | b10d3da883dc12fcd49d240eb5551de8c2e2198e (diff) |
Limit number of attribute threads to reduce thread ping pong
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp | 1 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/threading_service_config.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp b/searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp index 340619f09bd..20ec28929a1 100644 --- a/searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp +++ b/searchcore/src/tests/proton/documentdb/threading_service_config/threading_service_config_test.cpp @@ -42,6 +42,7 @@ TEST_F("require that indexing threads are set based on cpu cores and feeding con TEST_DO(f.assertIndexingThreads(3, 18)); TEST_DO(f.assertIndexingThreads(4, 19)); TEST_DO(f.assertIndexingThreads(4, 24)); + TEST_DO(f.assertIndexingThreads(4, 64)); } TEST_F("require that indexing threads is always >= 1", Fixture(0)) 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 8f1c3560e9b..07fb8fa102d 100644 --- a/searchcore/src/vespa/searchcore/proton/server/threading_service_config.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/threading_service_config.cpp @@ -22,7 +22,7 @@ namespace { uint32_t calculateIndexingThreads(uint32_t cfgIndexingThreads, double concurrency, const HwInfo::Cpu &cpuInfo) { - double scaledCores = cpuInfo.cores() * concurrency; + double scaledCores = std::min(12.0, cpuInfo.cores() * concurrency); uint32_t indexingThreads = std::max((uint32_t)std::ceil(scaledCores / 3), cfgIndexingThreads); return std::max(indexingThreads, 1u); } |