diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-08-02 09:12:25 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-08-02 12:04:34 +0200 |
commit | cc83212d4c9e1bce12977cdd6d7ff2049c3faa45 (patch) | |
tree | 95874d7a8ec74cbca0b7c8d7f0e868d82e8e2750 /config-model/src/main/java/com/yahoo/vespa/model/search/NodeResourcesTuning.java | |
parent | ef8786173aacd4cb9f12b05ce1eacce0bcc39a76 (diff) |
Revert "Revert "- initial document count must be number of unique documents per node." MERGEOK"
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/search/NodeResourcesTuning.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/search/NodeResourcesTuning.java | 8 |
1 files changed, 6 insertions, 2 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 1ad99404823..02f15ed06cd 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 @@ -4,6 +4,7 @@ package com.yahoo.vespa.model.search; import com.yahoo.config.provision.NodeResources; import com.yahoo.vespa.config.search.core.ProtonConfig; import com.yahoo.vespa.model.Host; +import com.yahoo.vespa.model.content.Redundancy; import static java.lang.Long.min; import static java.lang.Long.max; @@ -27,13 +28,16 @@ public class NodeResourcesTuning implements ProtonConfig.Producer { private final NodeResources resources; private final int threadsPerSearch; private final double fractionOfMemoryReserved; + private final Redundancy redundancy; public NodeResourcesTuning(NodeResources resources, int threadsPerSearch, - double fractionOfMemoryReserved) { + double fractionOfMemoryReserved, + Redundancy redundancy) { this.resources = resources; this.threadsPerSearch = threadsPerSearch; this.fractionOfMemoryReserved = fractionOfMemoryReserved; + this.redundancy = redundancy; } @Override @@ -57,7 +61,7 @@ public class NodeResourcesTuning implements ProtonConfig.Producer { ProtonConfig.Documentdb dbCfg = builder.build(); if (dbCfg.mode() != ProtonConfig.Documentdb.Mode.Enum.INDEX) { long numDocs = (long)usableMemoryGb() * GB / MEMORY_COST_PER_DOCUMENT_STORE_ONLY; - builder.allocation.initialnumdocs(numDocs); + builder.allocation.initialnumdocs(numDocs/redundancy.readyCopies()); } } |