aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2020-10-26 13:30:42 +0100
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2020-10-26 13:40:53 +0100
commit2db6c2ec5d6b6cd58feb0c8234161c189da04ce9 (patch)
tree5e8cbf1cb92b419f29338060ebd8ef0e61fb1638 /config-model/src
parent33d1633018a8ea5bb2998281c8490f099de3ac19 (diff)
Remove feature flags for feed/search/defalt threadpool scaling
Diffstat (limited to 'config-model/src')
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java16
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java16
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java7
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java1
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/SearchHandler.java7
-rwxr-xr-xconfig-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java11
6 files changed, 13 insertions, 45 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java
index e141826ba44..7628af85b52 100644
--- a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java
+++ b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java
@@ -72,12 +72,6 @@ public class TestProperties implements ModelContext.Properties {
@Override public boolean useDedicatedNodeForLogserver() { return useDedicatedNodeForLogserver; }
@Override public Optional<EndpointCertificateSecrets> endpointCertificateSecrets() { return endpointCertificateSecrets; }
@Override public double defaultTermwiseLimit() { return defaultTermwiseLimit; }
- @Override public double threadPoolSizeFactor() {
- return threadPoolSizeFactor;
- }
- @Override public double queueSizeFactor() {
- return queueSizeFactor;
- }
@Override public boolean useContentNodeBtreeDb() { return useContentNodeBtreeDb; }
@Override public boolean useThreePhaseUpdates() { return useThreePhaseUpdates; }
@Override public boolean useDirectStorageApiRpc() { return useDirectStorageApiRpc; }
@@ -137,16 +131,6 @@ public class TestProperties implements ModelContext.Properties {
return this;
}
- public TestProperties setThreadPoolSizeFactor(double threadPoolSizeFactor) {
- this.threadPoolSizeFactor = threadPoolSizeFactor;
- return this;
- }
-
- public TestProperties setQueueSizeFactor(double queueSizeFactor) {
- this.queueSizeFactor = queueSizeFactor;
- return this;
- }
-
public TestProperties setJettyThreadpoolSizeFactor(double factor) { this.jettyThreadpoolSizeFactor = factor; return this; }
public TestProperties setApplicationId(ApplicationId applicationId) {
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 e75ea26d065..c6f035b2885 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
@@ -34,7 +34,7 @@ public class ContainerDocumentApi {
"com.yahoo.vespa.http.server.FeedHandler", bindingSuffix, options);
cluster.addComponent(handler);
var executor = new Threadpool(
- "feedapi-handler", cluster, options.feedApiThreadpoolOptions, options.feedThreadPoolSizeFactor);
+ "feedapi-handler", cluster, options.feedApiThreadpoolOptions);
handler.inject(executor);
handler.addComponent(executor);
}
@@ -48,7 +48,7 @@ public class ContainerDocumentApi {
String bindingSuffix = "/document/v1/*";
var oldHandler = newVespaClientHandler(oldHandlerName, options.useNewRestapiHandler ? null : bindingSuffix, options);
cluster.addComponent(oldHandler);
- var executor = new Threadpool("restapi-handler", cluster, options.restApiThreadpoolOptions, options.feedThreadPoolSizeFactor);
+ var executor = new Threadpool("restapi-handler", cluster, options.restApiThreadpoolOptions);
oldHandler.inject(executor);
oldHandler.addComponent(executor);
@@ -85,18 +85,15 @@ public class ContainerDocumentApi {
private final Collection<String> bindings;
private final ContainerThreadpool.UserOptions restApiThreadpoolOptions;
private final ContainerThreadpool.UserOptions feedApiThreadpoolOptions;
- private final double feedThreadPoolSizeFactor;
private final boolean useNewRestapiHandler;
public Options(Collection<String> bindings,
ContainerThreadpool.UserOptions restApiThreadpoolOptions,
ContainerThreadpool.UserOptions feedApiThreadpoolOptions,
- double feedThreadPoolSizeFactor,
boolean useNewRestapiHandler) {
this.bindings = Collections.unmodifiableCollection(bindings);
this.restApiThreadpoolOptions = restApiThreadpoolOptions;
this.feedApiThreadpoolOptions = feedApiThreadpoolOptions;
- this.feedThreadPoolSizeFactor = feedThreadPoolSizeFactor;
this.useNewRestapiHandler = useNewRestapiHandler;
}
}
@@ -104,15 +101,12 @@ public class ContainerDocumentApi {
private static class Threadpool extends ContainerThreadpool {
private final ContainerCluster<?> cluster;
- private final double feedThreadPoolSizeFactor;
Threadpool(String name,
ContainerCluster<?> cluster,
- ContainerThreadpool.UserOptions threadpoolOptions,
- double feedThreadPoolSizeFactor ) {
+ ContainerThreadpool.UserOptions threadpoolOptions) {
super(name, threadpoolOptions);
this.cluster = cluster;
- this.feedThreadPoolSizeFactor = feedThreadPoolSizeFactor;
}
@Override
@@ -130,13 +124,13 @@ public class ContainerDocumentApi {
private int maxPoolSize() {
double vcpu = cluster.vcpu().orElse(0);
if (vcpu == 0) return FALLBACK_MAX_POOL_SIZE;
- return Math.max(2, (int)Math.ceil(vcpu * feedThreadPoolSizeFactor));
+ return Math.max(2, (int)Math.ceil(vcpu * 4.0));
}
private int minPoolSize() {
double vcpu = cluster.vcpu().orElse(0);
if (vcpu == 0) return FALLBACK_CORE_POOL_SIZE;
- return Math.max(1, (int)Math.ceil(vcpu * feedThreadPoolSizeFactor * 0.5));
+ return Math.max(1, (int)Math.ceil(vcpu * 2.0));
}
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java b/config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java
index 2db567b1460..344424ca8bf 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java
@@ -39,14 +39,13 @@ class DefaultThreadpoolProvider extends SimpleComponent implements ThreadpoolCon
return;
}
- double threadPoolSizeFactor = deployState.getProperties().threadPoolSizeFactor();
double vcpu = cluster.vcpu().orElse(0);
- if (threadPoolSizeFactor <= 0 || vcpu == 0) return;
+ if (vcpu == 0) return;
// Configuration is currently identical to the search handler's threadpool
- int workerThreads = Math.max(8, (int)Math.ceil(vcpu * threadPoolSizeFactor));
+ int workerThreads = Math.max(8, (int)Math.ceil(vcpu * 2.0));
builder.maxthreads(workerThreads);
builder.corePoolSize(workerThreads);
- builder.queueSize((int)(workerThreads * deployState.getProperties().queueSizeFactor()));
+ builder.queueSize((int)(workerThreads * 40.0));
}
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java
index 3baf792dfba..2a64a194d37 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/DocumentApiOptionsBuilder.java
@@ -25,7 +25,6 @@ public class DocumentApiOptionsBuilder {
getBindings(spec),
threadpoolOptions(spec, "rest-api"),
threadpoolOptions(spec, "http-client-api"),
- deployState.getProperties().feedCoreThreadPoolSizeFactor(),
deployState.getProperties().useNewRestapiHandler());
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/SearchHandler.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/SearchHandler.java
index ff6fd48c06a..3838dbae97a 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/SearchHandler.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/SearchHandler.java
@@ -56,22 +56,21 @@ class SearchHandler extends ProcessingHandler<SearchChains> {
// User options overrides below configuration
if (hasUserOptions()) return;
- double threadPoolSizeFactor = deployState.getProperties().threadPoolSizeFactor();
double vcpu = cluster.vcpu().orElse(0);
- if (threadPoolSizeFactor <= 0 || vcpu == 0) {
+ if (vcpu == 0) {
builder.maxThreads(500);
builder.minThreads(500);
builder.queueSize(0);
} else {
// Controls max number of concurrent requests per container
- int workerThreads = Math.max(8, (int)Math.ceil(vcpu * threadPoolSizeFactor));
+ int workerThreads = Math.max(8, (int)Math.ceil(vcpu * 2.0));
builder.maxThreads(workerThreads);
builder.minThreads(workerThreads);
// This controls your burst handling capability.
// 0 => No extra burst handling beyond you max concurrent requests (maxthreads).
// N => N times max concurrent requests as a buffer for handling bursts
- builder.queueSize((int)(workerThreads * deployState.getProperties().queueSizeFactor()));
+ builder.queueSize((int)(workerThreads * 40.0));
}
}
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java
index e5b2cc7e220..3da872c2f70 100755
--- a/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/container/ContainerClusterTest.java
@@ -216,11 +216,7 @@ public class ContainerClusterTest {
@Test
public void requireThatPoolAndQueueCanNotBeControlledByPropertiesWhenNoFlavor() {
- DeployState state = new DeployState.Builder().properties(new TestProperties()
- .setThreadPoolSizeFactor(8.5)
- .setQueueSizeFactor(13.3))
- .build();
- MockRoot root = new MockRoot("foo", state);
+ MockRoot root = new MockRoot("foo");
ApplicationContainerCluster cluster = createContainerCluster(root, false);
addContainer(root.deployLogger(), cluster, "c1", "host-c1");
root.freezeModelTopology();
@@ -262,9 +258,6 @@ public class ContainerClusterTest {
MockRoot root = new MockRoot(
"foo",
new DeployState.Builder()
- .properties(new TestProperties()
- .setThreadPoolSizeFactor(4)
- .setQueueSizeFactor(20))
.applicationPackage(new MockApplicationPackage.Builder().build())
.modelHostProvisioner(hostProvisioner)
.build());
@@ -276,7 +269,7 @@ public class ContainerClusterTest {
root.freezeModelTopology();
ThreadpoolConfig threadpoolConfig = root.getConfig(ThreadpoolConfig.class, "container0/component/default-threadpool");
- assertEquals(16, threadpoolConfig.maxthreads());
+ assertEquals(8, threadpoolConfig.maxthreads());
assertEquals(320, threadpoolConfig.queueSize());
}