zhangyue19921010 commented on a change in pull request #10524:
URL: https://github.com/apache/druid/pull/10524#discussion_r531676231



##########
File path: 
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java
##########
@@ -518,20 +684,52 @@ public SeekableStreamSupervisor(
     this.useExclusiveStartingSequence = useExclusiveStartingSequence;
     this.dataSource = spec.getDataSchema().getDataSource();
     this.ioConfig = spec.getIoConfig();
+    this.dynamicAllocationTasksProperties = 
ioConfig.getDynamicAllocationTasksProperties();
+    log.info("Get dynamicAllocationTasksProperties from IOConfig : " + 
dynamicAllocationTasksProperties);
+
+    if (dynamicAllocationTasksProperties != null && 
!dynamicAllocationTasksProperties.isEmpty() && 
Boolean.parseBoolean(String.valueOf(dynamicAllocationTasksProperties.getOrDefault("enableDynamicAllocationTasks",
 false)))) {
+      log.info("EnableDynamicAllocationTasks for datasource " + dataSource);
+      this.enableDynamicAllocationTasks = true;
+    } else {
+      log.info("Disable Dynamic Allocate Tasks");
+      this.enableDynamicAllocationTasks = false;
+    }
+    int taskCountMax = 0;
+    if (enableDynamicAllocationTasks) {
+      this.metricsCollectionIntervalMillis = 
Long.parseLong(String.valueOf(dynamicAllocationTasksProperties.getOrDefault("metricsCollectionIntervalMillis",
 10000)));
+      this.metricsCollectionRangeMillis = 
Long.parseLong(String.valueOf(dynamicAllocationTasksProperties.getOrDefault("metricsCollectionRangeMillis",
 6 * 10 * 1000)));
+      int slots = (int) (metricsCollectionRangeMillis / 
metricsCollectionIntervalMillis) + 1;
+      log.info(" The interval of metrics collection is " + 
metricsCollectionIntervalMillis + ", " + metricsCollectionRangeMillis + " 
timeRange will collect " + slots + " data points at most.");
+      this.queue = new CircularFifoQueue<>(slots);
+      taskCountMax = 
Integer.parseInt(String.valueOf(this.dynamicAllocationTasksProperties.getOrDefault("taskCountMax",
 8)));

Review comment:
       We have deployed this auto scale feature on PRD environment for half a 
year. And it works stably and efficiently. The default values of all parameters 
are the best practice values continuously adjusted according to the online 
conditions. And the max number of ingest tasks in our cluster is 8. Just in 
case, maybe 4 is more reasonable, avoiding using up all resources. And users 
can set a larger value if 4 is not satisfied.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to