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-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,9 +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 any two scale actions. Used as the default fallback when `minTriggerScaleUpActionFrequencyMillis` or `minTriggerScaleDownActionFrequencyMillis` are not set.|No|600000|
83
-
|`minTriggerScaleUpActionFrequencyMillis`|The minimum time interval between two scale-up actions. Falls back to `minTriggerScaleActionFrequencyMillis` if not set.|No||
84
-
|`minTriggerScaleDownActionFrequencyMillis`|The minimum time interval between two scale-down actions. Falls back to `minTriggerScaleActionFrequencyMillis` if not set.|No||
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|
85
85
|`autoScalerStrategy`|The algorithm of autoscaler. Druid only supports the `lagBased` strategy. See [Autoscaler strategy](#autoscaler-strategy) for more information.|No|`lagBased`|
86
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||
87
87
@@ -163,7 +163,8 @@ The following example shows a supervisor spec with `lagBased` autoscaler:
163
163
"enableTaskAutoScaler": true,
164
164
"taskCountMax": 6,
165
165
"taskCountMin": 2,
166
-
"minTriggerScaleActionFrequencyMillis": 600000,
166
+
"minScaleUpDelay": "PT10M",
167
+
"minScaleDownDelay": "PT10M",
167
168
"autoScalerStrategy": "lagBased",
168
169
"lagCollectionIntervalMillis": 30000,
169
170
"lagCollectionRangeMillis": 600000,
@@ -212,10 +213,11 @@ The following table outlines the configuration properties related to the `costBa
212
213
|`idleWeight`|The weight of extracted poll idle value in cost function. | No | 0.75 |
213
214
|`useTaskCountBoundaries`|Enables the bounded partitions-per-task window when selecting task counts.|No|`false`|
214
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|
215
-
|`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`|
216
218
|`scaleDownDuringTaskRolloverOnly`|Indicates whether task scaling down is limited to periods during task rollovers only.|No|`false`|
217
219
218
-
The following example shows a supervisor spec with `lagBased` autoscaler:
220
+
The following example shows a supervisor spec with `costBased` autoscaler:
219
221
220
222
<details>
221
223
<summary>Click to view the example</summary>
@@ -229,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
+9-17Lines changed: 9 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -552,31 +552,23 @@ public void handle()
552
552
// configure a longer cooldown for scale-down than for scale-up. Both directions are measured against the same
553
553
// last-scale timestamp so that a rapid up/down oscillation is still subject to the appropriate cooldown,
554
554
// regardless of which direction triggered last.
555
-
finallongeffectiveFreq;
556
555
finalScaleDirectionscaleDirection;
556
+
finallongcooldownMillis;
557
557
558
558
if (desiredTaskCount > currentTaskCount) {
559
-
// Scale up: use the scale-up specific frequency, falling back to base.
if (nowTime - dynamicTriggerLastScaleRunTime < effectiveFreq) {
566
+
if (nowTime - dynamicTriggerLastScaleRunTime < cooldownMillis) {
575
567
log.info(
576
-
"DynamicAllocationTasksNotice submitted again in [%d]ms, effective [%s] throttle is [%d]ms for supervisor[%s] for dataSource[%s], skipping it! desired task count is [%d], current task count is [%d]",
568
+
"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]",
577
569
nowTime - dynamicTriggerLastScaleRunTime,
578
570
scaleDirection,
579
-
effectiveFreq,
571
+
cooldownMillis,
580
572
supervisorId,
581
573
dataSource,
582
574
desiredTaskCount,
@@ -585,7 +577,7 @@ public void handle()
585
577
586
578
emitter.emit(event.setDimension(
587
579
AUTOSCALER_SKIP_REASON_DIMENSION,
588
-
"minTriggerScaleActionFrequencyMillis not elapsed yet"
* @param desiredActiveTaskCount desired taskCount computed from AutoScaler
635
627
* @return Boolean flag indicating if scale action was executed or not. If true, it will wait at least the configured
636
-
* minTriggerScale(Up|Down)ActionFrequencyMillis (falling back to minTriggerScaleActionFrequencyMillis) before the next same-direction 'changeTaskCount'.
637
-
* If false, it will do 'changeTaskCount' again after 'scaleActionPeriodMillis' millis.
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
Copy file name to clipboardExpand all lines: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -179,12 +179,12 @@ public int computeTaskCountForScaleAction()
179
179
180
180
// Perform scale-up actions; scale-down actions only if configured.
181
181
finalinttaskCount;
182
-
if (isScaleActionAllowed() && optimalTaskCount > currentTaskCount) {
182
+
if (isScaleActionAllowed(true) && optimalTaskCount > currentTaskCount) {
0 commit comments