Skip to content

Commit ef14274

Browse files
committed
Reverting trigger time, reducing mins
1 parent 71fcc5a commit ef14274

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

docs/changelog/128914.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pr: 128914
2-
summary: Set Adaptive Allocations Scale to Zero to 24h
2+
summary: Make Adaptive Allocations Scale to Zero configurable and set default to 24h
33
area: Machine Learning
44
type: enhancement
55
issues: []

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -739,25 +739,14 @@ public void loadExtensions(ExtensionLoader loader) {
739739
Setting.Property.NodeScope
740740
);
741741

742-
/**
743-
* The time interval between the adaptive allocations triggers.
744-
* This setting requires a reboot to take effect, as it is only consumed during startup.
745-
*/
746-
public static final Setting<TimeValue> DEFAULT_TIME_INTERVAL = Setting.timeSetting(
747-
"xpack.ml.trained_models.adaptive_allocations.trigger_time",
748-
TimeValue.timeValueSeconds(10),
749-
TimeValue.timeValueSeconds(10),
750-
Setting.Property.NodeScope
751-
);
752-
753742
/**
754743
* The time that has to pass after scaling up, before scaling down is allowed.
755744
* Note that the ML autoscaling has its own cooldown time to release the hardware.
756745
*/
757746
public static final Setting<TimeValue> SCALE_UP_COOLDOWN_TIME = Setting.timeSetting(
758747
"xpack.ml.trained_models.adaptive_allocations.scale_up_cooldown_time",
759748
TimeValue.timeValueMinutes(5),
760-
TimeValue.timeValueMinutes(5),
749+
TimeValue.timeValueMinutes(1),
761750
Property.Dynamic,
762751
Setting.Property.NodeScope
763752
);
@@ -772,7 +761,7 @@ public void loadExtensions(ExtensionLoader loader) {
772761
public static final Setting<TimeValue> SCALE_TO_ZERO_AFTER_NO_REQUESTS_TIME = Setting.timeSetting(
773762
"xpack.ml.trained_models.adaptive_allocations.scale_to_zero_time",
774763
TimeValue.timeValueHours(24),
775-
TimeValue.timeValueMinutes(15),
764+
TimeValue.timeValueMinutes(1),
776765
Property.Dynamic,
777766
Setting.Property.NodeScope
778767
);
@@ -853,7 +842,6 @@ public List<Setting<?>> getSettings() {
853842
DELAYED_DATA_CHECK_FREQ,
854843
DUMMY_ENTITY_MEMORY,
855844
DUMMY_ENTITY_PROCESSORS,
856-
DEFAULT_TIME_INTERVAL,
857845
SCALE_UP_COOLDOWN_TIME,
858846
SCALE_TO_ZERO_AFTER_NO_REQUESTS_TIME
859847
);

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerService.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ Collection<DoubleWithAttributes> observeDouble(Function<AdaptiveAllocationsScale
181181
}
182182
}
183183

184+
/**
185+
* The time interval between the adaptive allocations triggers.
186+
*/
187+
private static final long DEFAULT_TIME_INTERVAL_SECONDS = 10;
188+
184189
private static final Logger logger = LogManager.getLogger(AdaptiveAllocationsScalerService.class);
185190

186191
private final long timeIntervalSeconds;
@@ -218,7 +223,7 @@ public AdaptiveAllocationsScalerService(
218223
inferenceAuditor,
219224
meterRegistry,
220225
isNlpEnabled,
221-
MachineLearning.DEFAULT_TIME_INTERVAL.get(settings).getSeconds(),
226+
DEFAULT_TIME_INTERVAL_SECONDS,
222227
new AtomicLong(MachineLearning.SCALE_TO_ZERO_AFTER_NO_REQUESTS_TIME.get(settings).getSeconds()),
223228
new AtomicLong(MachineLearning.SCALE_UP_COOLDOWN_TIME.get(settings).getMillis())
224229
);

0 commit comments

Comments
 (0)