aboutsummaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2020-08-31 16:23:33 +0200
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2020-08-31 16:23:33 +0200
commit7db7686823dee270a446e55ae20313cb7f55ff0e (patch)
tree9ce6454ce38d3552cb0b786b4d47ec7f66c4b269 /config-model
parentfb84d303e6e1f4c434bafe44538dbf3689d3bddd (diff)
Define minimum values for core and max pool size
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java b/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java
index 0624028732f..a4737c9f54c 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java
@@ -101,12 +101,12 @@ public class ContainerDocumentApi {
.collect(Collectors.toList());
// We can only use host resource for calculation if all container nodes in the cluster are homogeneous (in terms of vcpu)
if (vcpus.size() != 1 || vcpus.get(0) == 0) return FALLBACK_MAX_POOL_SIZE;
- return (int)Math.ceil(vcpus.get(0));
+ return Math.max(2, (int)Math.ceil(vcpus.get(0)));
}
private static int corePoolSize(int maxPoolSize, Options options) {
if (maxPoolSize == FALLBACK_MAX_POOL_SIZE) return FALLBACK_CORE_POOL_SIZE;
- return (int) Math.ceil(options.feedCoreThreadPoolSizeFactor * maxPoolSize);
+ return Math.max(1, (int)Math.ceil(options.feedCoreThreadPoolSizeFactor * maxPoolSize));
}
public static final class Options {