You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ingestion/supervisor.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,9 @@ The following table outlines the configuration properties for `autoScalerConfig`
79
79
|`taskCountMax`|The maximum number of ingestion tasks. Must be greater than or equal to `taskCountMin`. If `taskCountMax` is greater than the number of Kafka partitions or Kinesis shards, Druid sets the maximum number of reading tasks to the number of Kafka partitions or Kinesis shards and ignores `taskCountMax`.|Yes||
80
80
|`taskCountMin`|The minimum number of ingestion tasks. When you enable the autoscaler, Druid computes the initial number of tasks to launch by checking the configs in the following order: `taskCountStart`, then `taskCount` (in `ioConfig`), then `taskCountMin`.|Yes||
81
81
|`taskCountStart`|Optional config to specify the number of ingestion tasks to start with. When you enable the autoscaler, Druid computes the initial number of tasks to launch by checking the configs in the following order: `taskCountStart`, then `taskCount` (in `ioConfig`), then `taskCountMin`.|No|`taskCount` or `taskCountMin`|
82
-
|`minTriggerScaleActionFrequencyMillis`|The minimum time interval between two scale actions.| No|600000|
82
+
|`minScaleUpDelay`|Minimum cooldown duration between scale-up actions, specified as an ISO-8601 duration string. Falls back to `minTriggerScaleActionFrequencyMillis` if not set.|No||
83
+
|`minScaleDownDelay`|Minimum cooldown duration between scale-down actions, specified as an ISO-8601 duration string. Falls back to `minTriggerScaleActionFrequencyMillis` if not set.|No||
84
+
|`minTriggerScaleActionFrequencyMillis`|**Deprecated.** Use `minScaleUpDelay` and `minScaleDownDelay` instead. Minimum time interval in milliseconds between scale actions, used as the fallback when the Duration-based fields are not set.|No|600000|
83
85
|`autoScalerStrategy`|The algorithm of autoscaler. Druid only supports the `lagBased` strategy. See [Autoscaler strategy](#autoscaler-strategy) for more information.|No|`lagBased`|
84
86
|`stopTaskCountRatio`|A variable version of `ioConfig.stopTaskCount` with a valid range of (0.0, 1.0]. Allows the maximum number of stoppable tasks in steady state to be proportional to the number of tasks currently running.|No||
85
87
@@ -161,7 +163,8 @@ The following example shows a supervisor spec with `lagBased` autoscaler:
161
163
"enableTaskAutoScaler": true,
162
164
"taskCountMax": 6,
163
165
"taskCountMin": 2,
164
-
"minTriggerScaleActionFrequencyMillis": 600000,
166
+
"minScaleUpDelay": "PT10M",
167
+
"minScaleDownDelay": "PT10M",
165
168
"autoScalerStrategy": "lagBased",
166
169
"lagCollectionIntervalMillis": 30000,
167
170
"lagCollectionRangeMillis": 600000,
@@ -210,10 +213,11 @@ The following table outlines the configuration properties related to the `costBa
210
213
|`idleWeight`|The weight of extracted poll idle value in cost function. | No | 0.75 |
211
214
|`useTaskCountBoundaries`|Enables the bounded partitions-per-task window when selecting task counts.|No|`false`|
212
215
|`highLagThreshold`|Average partition lag threshold that triggers burst scale-up when set to a value greater than `0`. Set to a negative value to disable burst scale-up.|No|-1|
213
-
|`minScaleDownDelay`|Minimum duration between successful scale actions, specified as an ISO-8601 duration string.|No|`PT30M`|
216
+
|`minScaleUpDelay`|Minimum cooldown duration after a scale-up action before the next scale-up is allowed, specified as an ISO-8601 duration string. Falls back to `minScaleDownDelay` if not set.|No||
217
+
|`minScaleDownDelay`|Minimum cooldown duration after a scale-down action before the next scale-down is allowed, specified as an ISO-8601 duration string.|No|`PT30M`|
214
218
|`scaleDownDuringTaskRolloverOnly`|Indicates whether task scaling down is limited to periods during task rollovers only.|No|`false`|
215
219
216
-
The following example shows a supervisor spec with `lagBased` autoscaler:
220
+
The following example shows a supervisor spec with `costBased` autoscaler:
217
221
218
222
<details>
219
223
<summary>Click to view the example</summary>
@@ -227,9 +231,10 @@ The following example shows a supervisor spec with `lagBased` autoscaler:
Copy file name to clipboardExpand all lines: extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorIOConfigTest.java
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -315,6 +315,8 @@ public void testAutoScalingConfigSerde() throws JsonProcessingException
Copy file name to clipboardExpand all lines: extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTest.java
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -306,7 +306,8 @@ public SeekableStreamIndexTaskClient<KafkaTopicPartition, Long> build(
Copy file name to clipboardExpand all lines: extensions-core/kinesis-indexing-service/src/test/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisorTest.java
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -310,7 +310,8 @@ public void testNoInitialStateWithAutoScaleOut() throws Exception
Copy file name to clipboardExpand all lines: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java
// 2) Make sure we wait for any pending completion tasks to finish.
529
+
// At this point there could be 2 generations of tasks: pending completion tasks (old generation), running tasks (current generation), and (after our scale) pending tasks (new generation).
530
+
// We want to avoid killing any old generation tasks preemptively, as that might cause the current generation tasks' offsets to become invalid.
507
531
for (CopyOnWriteArrayList<TaskGroup> list : pendingCompletionTaskGroups.values()) {
508
532
// There are expected to be pending tasks if this scaling is happening on task rollover
509
533
if (!list.isEmpty() && !isScalingTasksOnRollover.get()) {
if (nowTime - dynamicTriggerLastScaleRunTime < cooldownMillis) {
527
567
log.info(
528
-
"DynamicAllocationTasksNotice submitted again in [%d] millis, minTriggerDynamicFrequency is [%s] for supervisor[%s] for dataSource[%s], skipping it! desired task count is [%s], active task count is [%s]",
"DynamicAllocationTasksNotice submitted again in [%d]ms, [%s] cooldown is [%d]ms for supervisor[%s] for dataSource[%s], skipping it! desired task count is [%d], current task count is [%d]",
569
+
nowTime - dynamicTriggerLastScaleRunTime,
570
+
scaleDirection,
571
+
cooldownMillis,
531
572
supervisorId,
532
573
dataSource,
533
574
desiredTaskCount,
534
-
getActiveTaskGroupsCount()
575
+
currentTaskCount
535
576
);
536
577
537
-
if (desiredTaskCount > 0) {
538
-
emitter.emit(event.setDimension(
539
-
AUTOSCALER_SKIP_REASON_DIMENSION,
540
-
"minTriggerScaleActionFrequencyMillis not elapsed yet"
* After the taskCount is changed in SeekableStreamSupervisorIOConfig, next RunNotice will create scaled number of ingest tasks without resubmitting the supervisor.
587
625
*
588
626
* @param desiredActiveTaskCount desired taskCount computed from AutoScaler
589
-
* @return Boolean flag indicating if scale action was executed or not. If true, it will wait at least 'minTriggerScaleActionFrequencyMillis' before next 'changeTaskCount'.
590
-
* If false, it will do 'changeTaskCount' again after 'scaleActionPeriodMillis' millis.
627
+
* @return Boolean flag indicating if scale action was executed or not. If true, it will wait at least the configured
628
+
* minScaleUpDelay or minScaleDownDelay (falling back to minTriggerScaleActionFrequencyMillis) before the next
629
+
* same-direction 'changeTaskCount'. If false, it will do 'changeTaskCount' again after 'scaleActionPeriodMillis' millis.
Copy file name to clipboardExpand all lines: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/AutoScalerConfig.java
0 commit comments