diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-02 15:44:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-02 15:44:22 +0100 |
commit | f28ae4c9a633dd52f57401544b393b9eca54eba2 (patch) | |
tree | d32b7b233815801fa72043792156c7b887ba5dc6 | |
parent | e51a699e8dd09720590c64a4414b703a40f990f2 (diff) | |
parent | 9d1363fe106e4009ba2591bfd018385692ac1d07 (diff) |
Merge pull request #26275 from vespa-engine/balder/increase-flush-threads-if-high-memory
If there is a lot of memory, allow mor eflush threads.
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/search/NodeResourcesTuning.java | 4 | ||||
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/search/NodeResourcesTuningTest.java | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/NodeResourcesTuning.java b/config-model/src/main/java/com/yahoo/vespa/model/search/NodeResourcesTuning.java index b6a7fb6182e..ee18eceb719 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/NodeResourcesTuning.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/NodeResourcesTuning.java @@ -97,8 +97,10 @@ public class NodeResourcesTuning implements ProtonConfig.Producer { if (usableMemoryGb() < MIN_MEMORY_PER_FLUSH_THREAD_GB) { builder.maxconcurrent(1); } + double min_concurrent_mem = usableMemoryGb() / (2*MIN_MEMORY_PER_FLUSH_THREAD_GB); + double min_concurrent_cpu = resources.vcpu() * MAX_FLUSH_THREAD_RATIO; builder.maxconcurrent(Math.min(builder.build().maxconcurrent(), - Math.max(1, (int)Math.ceil(resources.vcpu()*MAX_FLUSH_THREAD_RATIO)))); + (int)Math.ceil(Math.max(min_concurrent_mem, min_concurrent_cpu)))); } private void tuneFlushStrategyTlsSize(ProtonConfig.Flush.Memory.Builder builder) { diff --git a/config-model/src/test/java/com/yahoo/vespa/model/search/NodeResourcesTuningTest.java b/config-model/src/test/java/com/yahoo/vespa/model/search/NodeResourcesTuningTest.java index a6d44d46dcb..9fe38512fc0 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/search/NodeResourcesTuningTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/search/NodeResourcesTuningTest.java @@ -183,6 +183,10 @@ public class NodeResourcesTuningTest { @Test public void require_that_concurrent_flush_threads_is_1_with_low_memory() { assertEquals(2, fromMemAndCpu(17, 9).flush().maxconcurrent()); + assertEquals(2, fromMemAndCpu(17, 64).flush().maxconcurrent()); // still capped by max + assertEquals(2, fromMemAndCpu(65, 8).flush().maxconcurrent()); // still capped by max + assertEquals(2, fromMemAndCpu(33, 8).flush().maxconcurrent()); + assertEquals(1, fromMemAndCpu(31, 8).flush().maxconcurrent()); assertEquals(1, fromMemAndCpu(15, 8).flush().maxconcurrent()); assertEquals(1, fromMemAndCpu(17, 8).flush().maxconcurrent()); assertEquals(1, fromMemAndCpu(15, 8).flush().maxconcurrent()); |