-
Notifications
You must be signed in to change notification settings - Fork 559
Open
Description
the maxConnections default value is -1, value - 1 usually means no limit in tomcat, but the maxConnTotal value in HttpClientBuilder must greater than 0 , if i dont config maxConnections , i got the max request per route is 5,The value is too low for online service.
org.mitre.dsmiley.httpproxy.ProxyServlet
protected int maxConnections = -1;
protected HttpClient createHttpClient() {
HttpClientBuilder clientBuilder = getHttpClientBuilder()
.setDefaultRequestConfig(buildRequestConfig())
.setDefaultSocketConfig(buildSocketConfig());
clientBuilder.setMaxConnTotal(maxConnections);
clientBuilder.setMaxConnPerRoute(maxConnections);
if(! doHandleCompression) {
clientBuilder.disableContentCompression();
}
if (useSystemProperties)
clientBuilder = clientBuilder.useSystemProperties();
return buildHttpClient(clientBuilder);
}
org/apache/http/impl/client/HttpClientBuilder.java
if (systemProperties) {
String s = System.getProperty("http.keepAlive", "true");
if ("true".equalsIgnoreCase(s)) {
s = System.getProperty("http.maxConnections", "5");
final int max = Integer.parseInt(s);
poolingmgr.setDefaultMaxPerRoute(max);
poolingmgr.setMaxTotal(2 * max);
}
}
if (maxConnTotal > 0) {
poolingmgr.setMaxTotal(maxConnTotal);
}
if (maxConnPerRoute > 0) {
poolingmgr.setDefaultMaxPerRoute(maxConnPerRoute);
}
Metadata
Metadata
Assignees
Labels
No labels