diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-11 12:05:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 12:05:29 +0100 |
commit | ca6ecdb8c1d9a37dd0a28c16d217b4f113624478 (patch) | |
tree | 15137d4793ce346aa97b2693cd3fbcc691702dc3 /config-model | |
parent | a782d867784893696b3f505f547b9ccc1a5fcf2b (diff) | |
parent | d6876ea57a08a3f84f2d3ef47543bf877dc90f7f (diff) |
Merge pull request #16281 from vespa-engine/balder/metricsproxy-and-clustercontroller-only-need-a-handfull-of-threads
We only new a handfull of threads for the httpserver in the clusterco…
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java b/config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java index 578f5b666b7..b28a2edff0e 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java @@ -6,6 +6,7 @@ import com.yahoo.component.ComponentSpecification; import com.yahoo.container.bundle.BundleInstantiationSpecification; import com.yahoo.jdisc.http.ServerConfig; import com.yahoo.osgi.provider.model.ComponentModel; +import com.yahoo.vespa.model.container.ApplicationContainerCluster; import com.yahoo.vespa.model.container.ContainerCluster; import com.yahoo.vespa.model.container.component.SimpleComponent; @@ -45,14 +46,6 @@ public class JettyHttpServer extends SimpleComponent implements ServerConfig.Pro addChild(connectorFactory); } - public void removeConnector(ConnectorFactory connectorFactory) { - if (connectorFactory == null) { - return; - } - removeChild(connectorFactory); - connectorFactories.remove(connectorFactory); - } - public List<ConnectorFactory> getConnectorFactories() { return Collections.unmodifiableList(connectorFactories); } @@ -82,10 +75,17 @@ public class JettyHttpServer extends SimpleComponent implements ServerConfig.Pro private void configureJettyThreadpool(ServerConfig.Builder builder) { if (cluster == null) return; + if (cluster instanceof ApplicationContainerCluster) { + configureApplicationClusterJettyThreadPool(builder); + } else { + builder.minWorkerThreads(2).maxWorkerThreads(4); + } + } + private void configureApplicationClusterJettyThreadPool(ServerConfig.Builder builder) { double vcpu = cluster.vcpu().orElse(0); if (vcpu > 0) { int threads = 16 + (int) Math.ceil(vcpu); - builder.maxWorkerThreads(threads).minWorkerThreads(threads); + builder.minWorkerThreads(threads).maxWorkerThreads(threads); } } |