summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java30
1 files changed, 9 insertions, 21 deletions
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 e0d4f3c0692..0b37abaded9 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
@@ -5,7 +5,6 @@ import com.yahoo.container.bundle.BundleInstantiationSpecification;
import com.yahoo.container.handler.ThreadPoolProvider;
import com.yahoo.container.handler.ThreadpoolConfig;
import com.yahoo.osgi.provider.model.ComponentModel;
-import com.yahoo.vespa.model.admin.metricsproxy.MetricsProxyContainerCluster;
import com.yahoo.vespa.model.container.component.SimpleComponent;
/**
@@ -16,38 +15,27 @@ import com.yahoo.vespa.model.container.component.SimpleComponent;
class DefaultThreadpoolProvider extends SimpleComponent implements ThreadpoolConfig.Producer {
private final ContainerCluster<?> cluster;
- private final int metricsproxyNumThreads;
+ private final int defaultWorkerThreads;
- DefaultThreadpoolProvider(ContainerCluster<?> cluster, int metricsproxyNumThreads) {
+ DefaultThreadpoolProvider(ContainerCluster<?> cluster, int defaultWorkerThreads) {
super(new ComponentModel(
BundleInstantiationSpecification.getFromStrings(
"default-threadpool",
ThreadPoolProvider.class.getName(),
null)));
this.cluster = cluster;
- this.metricsproxyNumThreads = metricsproxyNumThreads;
- }
-
- private int defaultThreadsByClusterType() {
- if (cluster instanceof MetricsProxyContainerCluster) {
- return metricsproxyNumThreads;
- }
- return 10;
+ this.defaultWorkerThreads = defaultWorkerThreads;
}
@Override
public void getConfig(ThreadpoolConfig.Builder builder) {
- if (!(cluster instanceof ApplicationContainerCluster)) {
+ if (cluster instanceof ApplicationContainerCluster) {
+ // Core pool size of 2xcores, and max of 100xcores and using a synchronous Q
+ // This is the deafault pool used by both federation and generally when you ask for an Executor.
+ builder.corePoolSize(-2).maxthreads(-100).queueSize(0);
+ } else {
// Container clusters such as logserver, metricsproxy and clustercontroller
- int defaultWorkerThreads = defaultThreadsByClusterType();
- builder.maxthreads(defaultWorkerThreads);
- builder.corePoolSize(defaultWorkerThreads);
- builder.queueSize(50);
- return;
+ builder.corePoolSize(defaultWorkerThreads).maxthreads(defaultWorkerThreads).queueSize(50);
}
-
- // Core pool size of 2xcores, and max of 100xcores and using a synchronous Q
- // This is the deafault pool used by both federation and generally when you ask for an Executor.
- builder.corePoolSize(-2).maxthreads(-100).queueSize(0);
}
}