Skip to content

Conversation

prwhelan
Copy link
Member

@prwhelan prwhelan commented Jun 4, 2025

Adaptive Allocations will now wait 24 hours to scale down to zero allocations (from one allocation).

xpack.ml.trained_models.adaptive_allocations.scale_to_zero_time can be used to change this time from 24 hours to a minimum of 15 minutes.

xpack.ml.trained_models.adaptive_allocations.scale_cooldown_time can be used to change the time adaptive allocation scales between 1 and max allocations. Defaults to 5 minutes.

Adaptive Allocations will now wait 24 hours to scale down to zero allocations (from one allocation). `xpack.ml.trained_models.adaptive_allocations.scale_to_zero_time` can be used to change this time from 24 hours to a minimum of 15 minutes. `xpack.ml.trained_models.adaptive_allocations.scale_cooldown_time` can be used to change the time adaptive allocation scales between 1 and max allocations. Defaults to 5 minutes. `xpack.ml.trained_models.adaptive_allocations.trigger_time` can be used to change the time adaptive allocations tries to scale. Defaults to 15 minutes.
@prwhelan prwhelan added >enhancement :ml Machine learning Team:ML Meta label for the ML team v9.1.0 labels Jun 4, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @prwhelan, I've created a changelog YAML for you.

@prwhelan prwhelan marked this pull request as ready for review June 4, 2025 15:21
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

Copy link
Contributor

@jan-elastic jan-elastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,5 @@
pr: 128914
summary: Set Adaptive Allocations Scale to Zero to 24h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be: "make configurable ... and set default to 24h"

public static final Setting<TimeValue> DEFAULT_TIME_INTERVAL = Setting.timeSetting(
"xpack.ml.trained_models.adaptive_allocations.trigger_time",
TimeValue.timeValueSeconds(10),
TimeValue.timeValueSeconds(10),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the minimum times (here and underneath)?

I you want an allocation to go away after 1 minute of idleness, I think you should be able to do so

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I picked the current settings as the min settings, but we can lower them to 1 minute, I don't mind either way. I think values lower than 1m may cause too much thrashing for the autoscaler

public static final Setting<TimeValue> DEFAULT_TIME_INTERVAL = Setting.timeSetting(
"xpack.ml.trained_models.adaptive_allocations.trigger_time",
TimeValue.timeValueSeconds(10),
TimeValue.timeValueSeconds(10),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I'm not convinced this trigger time should be configurable

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@prwhelan prwhelan enabled auto-merge (squash) June 5, 2025 15:42
@prwhelan prwhelan merged commit 0a5dfc0 into elastic:main Jun 6, 2025
17 of 18 checks passed
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jun 9, 2025
Adaptive Allocations will now wait 24 hours to scale down to zero allocations (from one allocation). `xpack.ml.trained_models.adaptive_allocations.scale_to_zero_time` can be used to change this time from 24 hours to a minimum of 1 minute. `xpack.ml.trained_models.adaptive_allocations.scale_cooldown_time` can be used to change the time adaptive allocation scales between 1 and max allocations. Defaults to 5 minutes.
valeriy42 pushed a commit to valeriy42/elasticsearch that referenced this pull request Jun 12, 2025
Adaptive Allocations will now wait 24 hours to scale down to zero allocations (from one allocation). `xpack.ml.trained_models.adaptive_allocations.scale_to_zero_time` can be used to change this time from 24 hours to a minimum of 1 minute. `xpack.ml.trained_models.adaptive_allocations.scale_cooldown_time` can be used to change the time adaptive allocation scales between 1 and max allocations. Defaults to 5 minutes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :ml Machine learning Team:ML Meta label for the ML team v9.1.0

4 participants