diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-01-16 22:01:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-16 22:01:49 +0100 |
commit | c318c148a4d347128d931b8e53f99161cd840030 (patch) | |
tree | cb83358e6b041f0bbc19c8b0897394c11be9c7f7 /config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java | |
parent | 694f3e7367e3cb89d56ee4f50797763f24f62574 (diff) | |
parent | 9a4b0b11a9b168698f94e45a3023215dcdcd975f (diff) |
Merge pull request #20823 from vespa-engine/balder/only-2-threads-for-ccv7.528.38
All non application clusters only needs a few threads. 2 should be su…
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.java | 30 |
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); } } |