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

CA(AliCloud):Large sudden increase in instances not managed by ASG can impact CA performance #6748

Open
guopeng0 opened this issue Apr 24, 2024 · 1 comment · May be fixed by #6749
Open
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@guopeng0
Copy link
Contributor

guopeng0 commented Apr 24, 2024

Currently, the implementation of the NodeGroupForNode function in the AliCloudProvider has two caches within autoScalingGroups: instanceToAsg and instancesNotInManagedAsg.

instanceToAsg records instances in Managed ASGs.
instancesNotInManagedAsg records instances not in Managed ASGs.
When an unknown instance is encountered, a regenerateCache is triggered. If it’s determined to be an instance not in a Managed ASG, it’s saved to instancesNotInManagedAsg, avoiding the need to call regenerateCache on subsequent occurrences.

This functionality is correct. However, if a large number of nodes are created via instances not in Managed ASGs, every call to NodeGroupForNode->GetAsgForInstance->FindForInstance will trigger a regenerateCache. If there are a significant number of instances in Managed ASGs at that time, this could lead to frequent calls, each with a considerable time overhead for regenerateCache.

For example, if there are 1000 machines in Managed ASGs and suddenly 2000 instances not in Managed ASGs are added:

UpdateNodes->updateReadinessStats->NodeGroupForNode
This call is executed with every runOnce, and each node invokes NodeGroupForNode once. The 2000 newly added instances not in Managed ASGs will trigger regenerateCache, but it will only count instances in Managed ASGs. However, it will still execute 2000 times.

Assuming each regenerateCache call takes 10 seconds, this function will take:

2000 instances * 10 seconds/instance = 20000 seconds.
This significantly extends the duration of a single runOnce operation. During this period, if new pending pods appear, the Cluster Autoscaler might not function as expected, posing a severe risk.

@guopeng0 guopeng0 added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 24, 2024
@guopeng0 guopeng0 changed the title Large sudden increase in instances not managed by ASG can impact CA performance CA(AliCloud):Large sudden increase in instances not managed by ASG can impact CA performance Apr 24, 2024
@songminglong
Copy link

We changed this implementation a year ago. We prefer the implementation of AWS. Currently, our startup time is very fast, reduced from 40 minutes to 2 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants