Skip to content

Commit

Permalink
Fix request thread-pool initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
enricovianello committed Mar 16, 2024
1 parent ebe83ec commit a3e5ed2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public interface ServiceConfiguration {

public long getTrustAnchorsRefreshIntervalInSeconds();

public int getMinConnections();

public int getMaxConnections();

public int getMaxQueueSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,14 @@ public static class ConnectorProperties {
@Max(65536)
int securePort = 8443;

@Positive
int minConnections = 10;

@Positive
int maxConnections = 200;

@Positive
int maxQueueSize = 512;
int maxQueueSize = 50;

@Positive
int maxIdleTimeMsec = 30000;
Expand Down Expand Up @@ -292,6 +295,14 @@ public void setSecurePort(int securePort) {
this.securePort = securePort;
}

public int getMinConnections() {
return minConnections;
}

public void setMinConnections(int minConnections) {
this.minConnections = minConnections;
}

public int getMaxConnections() {
return maxConnections;
}
Expand Down Expand Up @@ -732,6 +743,10 @@ public long getTrustAnchorsRefreshIntervalInSeconds() {
return getTls().getTrustAnchorsRefreshIntervalSecs();
}

@Override
public int getMinConnections() {
return getConnector().getMinConnections();
}

@Override
public int getMaxConnections() {
Expand Down Expand Up @@ -887,4 +902,5 @@ public TapeProperties getTape() {
public void setTape(TapeProperties tape) {
this.tape = tape;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public void customize(JettyServletWebServerFactory factory) {

factory.setThreadPool(ThreadPoolBuilder.instance()
.withMaxRequestQueueSize(configuration.getMaxQueueSize())
.withMaxThreads(serverProperties.getJetty().getThreads().getMax())
.withMinThreads(serverProperties.getJetty().getThreads().getMin())
.withMaxThreads(configuration.getMaxConnections())
.withMinThreads(configuration.getMinConnections())
.registry(metricRegistry)
.withPrefix("storm.http")
.withName("thread-pool")
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ storm:
port: ${STORM_WEBDAV_HTTP_PORT:8085}
# HTTPS connector port
secure-port: ${STORM_WEBDAV_HTTPS_PORT:8443}
# Min concurrent connections
min-connections: ${STORM_WEBDAV_MIN_CONNECTIONS:50}
# Max concurrent connections
max-connections: ${STORM_WEBDAV_MAX_CONNECTIONS:300}
# Connection queue size
Expand Down

0 comments on commit a3e5ed2

Please sign in to comment.