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
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -208,6 +208,8 @@ The following table outlines the configuration properties related to the `costBa
208
208
|`lagWeight`|The weight of extracted lag value in cost function.| No| 0.25|
209
209
|`idleWeight`|The weight of extracted poll idle value in cost function. | No | 0.75 |
210
210
|`defaultProcessingRate`|A planned processing rate per task, required for first cost estimations. | No | 1000 |
211
+
|`scaleDownBarrier`| A number of successful scale down attempts which should be skipped to prevent the auto-scaler from scaling down tasks immediately. | No | 5 |
212
+
|`scaleDownDuringTaskRolloverOnly`| Indicates whether task scaling down is limited to periods during task rollovers only. | No | False |
211
213
212
214
The following example shows a supervisor spec with `lagBased` autoscaler:
Copy file name to clipboardExpand all lines: embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/autoscaler/CostBasedAutoScalerIntegrationTest.java
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,8 @@ public void test_autoScaler_computesOptimalTaskCountAndProduceScaleDown()
132
132
// Weight configuration: strongly favor lag reduction over idle time
Copy file name to clipboardExpand all lines: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java
+17-3Lines changed: 17 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,8 @@ public class CostBasedAutoScaler implements SupervisorTaskAutoScaler
90
90
privatefinalWeightedCostFunctioncostFunction;
91
91
privatevolatileCostMetricslastKnownMetrics;
92
92
93
+
privateintscaleDownCounter = 0;
94
+
93
95
publicCostBasedAutoScaler(
94
96
SeekableStreamSupervisorsupervisor,
95
97
CostBasedAutoScalerConfigconfig,
@@ -148,7 +150,12 @@ public void reset()
148
150
@Override
149
151
publicintcomputeTaskCountForRollover()
150
152
{
151
-
returncomputeOptimalTaskCount(lastKnownMetrics);
153
+
if (config.isScaleDownOnTaskRolloverOnly()) {
154
+
returncomputeOptimalTaskCount(lastKnownMetrics);
155
+
} else {
156
+
scaleDownCounter = 0;
157
+
return -1;
158
+
}
152
159
}
153
160
154
161
publicintcomputeTaskCountForScaleAction()
@@ -157,11 +164,18 @@ public int computeTaskCountForScaleAction()
Copy file name to clipboardExpand all lines: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScalerConfig.java
Copy file name to clipboardExpand all lines: indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScalerConfigTest.java
0 commit comments