-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Limit the rate of adding new uneeded nodes #5556
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: x13n The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1a59ec2
to
07b3783
Compare
if u < loopInterval { | ||
u = loopInterval | ||
} | ||
upperBound := n * int(u/loopInterval) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have higher limit.
If ScaleDownUnneededTime=60s, and loopInterval=10s we will have upperBound 6n. Imagine it's smaller than limit.
Each loop we will remove n nodes, so 6n nodes we will remove in exactly 1minute. However if CA have filtered some nodes in NodesToDelete (because min size would be violate or resource limits) we would have <6n nodes, let's say 3n which we will be able to remove in 30 seconds and so other empty nodes won't start removal because unneeded time haven't pass yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. This is exactly what the extra buffer is for, so adding it here so that it is consistent between limit
and upperBound
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This is an optimization to avoid spending too much time in scale down simulation. The main idea is that it doesn't make sense to add new unneeded nodes at a rate that is higher than the rate at which we can delete them afterwards.
/lgtm |
This is an optimization to avoid spending too much time in scale down simulation. The main idea is that it doesn't make sense to add new unneeded nodes at a rate that is higher than the rate at which we can delete them afterwards.
What type of PR is this?
What this PR does / why we need it:
Faster scale down in large clusters.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: