capistrant commented on code in PR #19271:
URL: https://github.com/apache/druid/pull/19271#discussion_r3399210525
##########
services/src/main/java/org/apache/druid/cli/CliCoordinator.java:
##########
@@ -229,6 +231,19 @@ public void configure(Binder binder)
binder.bind(JettyServerInitializer.class)
.to(CoordinatorJettyServerInitializer.class);
+ // QoS filtering to prevent heavy coordinator API requests from
starving health check endpoints.
+ // Set druid.coordinator.server.maxConcurrentRequests=-1 to
disable.
+ final int serverHttpNumThreads =
ServerConfig.getNumThreadsFromProperties(properties);
+ final int maxConcurrentRequests =
properties.containsKey("druid.coordinator.server.maxConcurrentRequests")
+ ?
Integer.parseInt(properties.getProperty("druid.coordinator.server.maxConcurrentRequests"))
+ :
ServerConfig.getDefaultMaxConcurrentRequests(serverHttpNumThreads);
+ if (maxConcurrentRequests > 0) {
+ log.info("Coordinator QoS filtering enabled. Max concurrent
requests: [%d]", maxConcurrentRequests);
+ JettyBindings.addQosFilter(binder, new
String[]{"/druid/coordinator/v1/*", "/druid-internal/*"},
maxConcurrentRequests);
Review Comment:
could consider writing a CliCoordinatorTest and testing that this binding is
added when desired
##########
services/src/main/java/org/apache/druid/cli/CliCoordinator.java:
##########
@@ -229,6 +231,19 @@ public void configure(Binder binder)
binder.bind(JettyServerInitializer.class)
.to(CoordinatorJettyServerInitializer.class);
+ // QoS filtering to prevent heavy coordinator API requests from
starving health check endpoints.
+ // Set druid.coordinator.server.maxConcurrentRequests=-1 to
disable.
+ final int serverHttpNumThreads =
ServerConfig.getNumThreadsFromProperties(properties);
+ final int maxConcurrentRequests =
properties.containsKey("druid.coordinator.server.maxConcurrentRequests")
+ ?
Integer.parseInt(properties.getProperty("druid.coordinator.server.maxConcurrentRequests"))
+ :
ServerConfig.getDefaultMaxConcurrentRequests(serverHttpNumThreads);
+ if (maxConcurrentRequests > 0) {
+ log.info("Coordinator QoS filtering enabled. Max concurrent
requests: [%d]", maxConcurrentRequests);
+ JettyBindings.addQosFilter(binder, new
String[]{"/druid/coordinator/v1/*", "/druid-internal/*"},
maxConcurrentRequests);
Review Comment:
There are a bunch of light service status endpoints under
`/druid/coordinator/v1/*`. found here:
https://druid.apache.org/docs/latest/api-reference/service-status-api ... do we
really want those blanketed under Qos? I think that `isLeader` could
specifically be sensitive to Qos restrictions since monitors/loadBalancers
could rely on it. also plain `leader` maybe
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]