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

Limit the rate of adding new uneeded nodes #5556

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

x13n
Copy link
Member

@x13n x13n commented Mar 2, 2023

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?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 2, 2023
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added area/cluster-autoscaler approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 2, 2023
@x13n x13n force-pushed the fast-sd branch 2 times, most recently from 1a59ec2 to 07b3783 Compare March 2, 2023 14:09
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 2, 2023
@x13n x13n changed the title WIP: Limit the rate of adding new uneeded nodes Limit the rate of adding new uneeded nodes Mar 2, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 2, 2023
if u < loopInterval {
u = loopInterval
}
upperBound := n * int(u/loopInterval)
Copy link
Contributor

@yaroslava-serdiuk yaroslava-serdiuk Mar 2, 2023

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.

Copy link
Member Author

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.

Copy link
Contributor

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.
@yaroslava-serdiuk
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 2, 2023
@k8s-ci-robot k8s-ci-robot merged commit e551e1f into kubernetes:master Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants