Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accept max_scale_up and max_scale_down for target-value #848

Merged
merged 2 commits into from
Feb 10, 2024

Conversation

brmzkw
Copy link
Contributor

@brmzkw brmzkw commented Feb 6, 2024

Hey,

The two optional parameters max_scale_up and max_scale_down determine the maximum and minimum number of scaling differences between two evaluations.

It is useful to avoid scaling down or scaling up a job too quickly.

The code is not tested yet. For now, this is a draft pull request to see if you might be interested to include the feature in the target-value plugin.

@hashicorp-cla
Copy link

hashicorp-cla commented Feb 6, 2024

CLA assistant check
All committers have signed the CLA.

@brmzkw brmzkw force-pushed the main branch 2 times, most recently from c65590d to a1f5677 Compare February 7, 2024 10:29
@brmzkw
Copy link
Contributor Author

brmzkw commented Feb 7, 2024

I've force-pushed the unit tests. Feel free to reach out if there are any queries!

@brmzkw brmzkw force-pushed the main branch 2 times, most recently from bebe6b2 to cd52cc6 Compare February 7, 2024 21:20
Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution @brmzkw! I really like the idea 🙂

It provides a stepped scaling instead of potentially abrupt changes. I was thinking if we could adopt this configuration more broadly such that it could be used with any strategy:

policy {
  # ...
  max_scale_up   = 10
  max_scale_down = 3
  # ...
}

But looking at the other strategies we have so far they seem more controlled than target-value because they usually define static changes. We can always expand later if we find the need.

Would be able to write some docs for these new config in https://github.com/hashicorp/nomad/blob/main/website/content/tools/autoscaling/plugins/strategy/target-value.mdx?

brmzkw and others added 2 commits February 9, 2024 19:24
The two optional parameters max_scale_up and max_scale_down determine
the maximum and minimum number of scaling differences between two
evaluations.

It is useful to avoid scaling down or scaling up a job too quickly.
@lgfa29 lgfa29 merged commit a4e70bc into hashicorp:main Feb 10, 2024
1 check passed
@brmzkw
Copy link
Contributor Author

brmzkw commented Feb 12, 2024

But looking at the other strategies we have so far they seem more controlled than target-value because they usually define static changes. We can always expand later if we find the need.

This is why I implemented it in the target-value plugin. For example, I'm not sure it would make sense to have these parameters for the pass-through or for the fixed-value strategies.

Thanks for the merge, I'll update the documentation today.

Do you know when you intend to make a release?

@lgfa29
Copy link
Contributor

lgfa29 commented Feb 12, 2024

No specific date yet, but we will probably release a new version soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants