mirror of https://github.com/apache/druid.git
Merge pull request #1240 from himanshug/async_query_forwarding_servlet_router_fix
adding router numMaxThread configuration for ProxyServlet HttpClient executor
This commit is contained in:
commit
47cc11829d
|
@ -56,6 +56,9 @@ druid.router.tierToBrokerMap={"hot":"druid:prod:broker-hot","_default_tier":"dru
|
||||||
druid.router.http.numConnections=50
|
druid.router.http.numConnections=50
|
||||||
druid.router.http.readTimeout=PT5M
|
druid.router.http.readTimeout=PT5M
|
||||||
|
|
||||||
|
# Number of threads used by the router proxy http client
|
||||||
|
druid.router.http.numMaxThreads=100
|
||||||
|
|
||||||
druid.server.http.numThreads=100
|
druid.server.http.numThreads=100
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,10 @@ public class DruidHttpClientConfig
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private Period readTimeout = new Period("PT15M");
|
private Period readTimeout = new Period("PT15M");
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
@Min(1)
|
||||||
|
private int numMaxThreads = Math.max(10, (Runtime.getRuntime().availableProcessors() * 17) / 16 + 2) + 30;
|
||||||
|
|
||||||
public int getNumConnections()
|
public int getNumConnections()
|
||||||
{
|
{
|
||||||
return numConnections;
|
return numConnections;
|
||||||
|
@ -44,4 +48,9 @@ public class DruidHttpClientConfig
|
||||||
{
|
{
|
||||||
return readTimeout == null ? null : readTimeout.toStandardDuration();
|
return readTimeout == null ? null : readTimeout.toStandardDuration();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getNumMaxThreads()
|
||||||
|
{
|
||||||
|
return numMaxThreads;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,11 @@ public class RouterJettyServerInitializer implements JettyServerInitializer
|
||||||
requestLogger
|
requestLogger
|
||||||
);
|
);
|
||||||
asyncQueryForwardingServlet.setTimeout(httpClientConfig.getReadTimeout().getMillis());
|
asyncQueryForwardingServlet.setTimeout(httpClientConfig.getReadTimeout().getMillis());
|
||||||
root.addServlet(new ServletHolder(asyncQueryForwardingServlet), "/druid/v2/*");
|
ServletHolder sh = new ServletHolder(asyncQueryForwardingServlet);
|
||||||
|
//NOTE: explicit maxThreads to workaround https://tickets.puppetlabs.com/browse/TK-152
|
||||||
|
sh.setInitParameter("maxThreads", Integer.toString(httpClientConfig.getNumMaxThreads()));
|
||||||
|
|
||||||
|
root.addServlet(sh, "/druid/v2/*");
|
||||||
JettyServerInitUtils.addExtensionFilters(root, injector);
|
JettyServerInitUtils.addExtensionFilters(root, injector);
|
||||||
root.addFilter(JettyServerInitUtils.defaultAsyncGzipFilterHolder(), "/*", null);
|
root.addFilter(JettyServerInitUtils.defaultAsyncGzipFilterHolder(), "/*", null);
|
||||||
// Can't use '/*' here because of Guice conflicts with AsyncQueryForwardingServlet path
|
// Can't use '/*' here because of Guice conflicts with AsyncQueryForwardingServlet path
|
||||||
|
|
Loading…
Reference in New Issue