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 · 4 comments · May be fixed by #6749
Open

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

guopeng0 opened this issue Apr 24, 2024 · 4 comments · May be fixed by #6749
Labels
area/cluster-autoscaler kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

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.

@adrianmoisey
Copy link
Member

/area cluster-autoscaler

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 6, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cluster-autoscaler kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants