-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Upstream core Kubernetes HPA loop is single-threaded #2382
Labels
bug
Something isn't working
stale-bot-ignore
All issues that should not be automatically closed by our stale bot
upstream-integration
All issues related to upstream Kubernetes/community
Comments
Thanks for documenting this, we should try to work with SIG Autoscaling to tackle this. |
tomkerkhove
added
the
upstream-integration
All issues related to upstream Kubernetes/community
label
Dec 7, 2021
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed due to inactivity. |
Repository owner
moved this from To Do
to Ready To Ship
in Roadmap - KEDA Core
Feb 12, 2022
zroubalik
added
the
stale-bot-ignore
All issues that should not be automatically closed by our stale bot
label
Feb 12, 2022
stale
bot
removed
the
stale
All issues that are marked as stale due to inactivity
label
Feb 12, 2022
Repository owner
moved this from Ready To Ship
to Proposed
in Roadmap - KEDA Core
Feb 12, 2022
This has been fixed upstream. |
github-project-automation
bot
moved this from Proposed
to Ready To Ship
in Roadmap - KEDA Core
Oct 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
stale-bot-ignore
All issues that should not be automatically closed by our stale bot
upstream-integration
All issues related to upstream Kubernetes/community
Report
I am leveraging Keda to query Prometheus for metrics to use in scaling decisions. Core Kubernetes appears to have some poor performance when it comes to operation with many external metrics based queries. The core HPA loop is single-threaded and acts on a single HPA object at a time in a blocking fashion on every loop iteration.
This core HPA loop should be concurrent and process every HPA object of the cluster at once as there is no mutability of the HPA objects themselves caused by other HPA objects.
This has an associated upstream issue opened describing the issuehere
The single threaded nature can be found here
Expected Behavior
Kubernetes' core HPA loop to be performant
Actual Behavior
It's possible for scaling decisions to be greatly delayed due to the sequential blocking nature of the core HPA loop. HPA simply cannot process all HPA objects sequentially in a timely manner.
Steps to Reproduce the Problem
Create and install the https://github.com/kubernetes-sigs/custom-metrics-apiserver and alter its code to add a delay in the GetExternalMetric method of the Testing Provider
Also add logging to the method with timestamps logrus supports timestamps, e.g.
Create 1,000 HPA objects referring to that test metric - possibly 1,000 deployments as well, but one will work fine too even if not a real use case.
Pick one of your HPA's and watch for the time between its call to GetExternalMetric.
Logs from KEDA operator
.
KEDA Version
2.5.0
Kubernetes Version
1.20
Platform
Any
Scaler Details
All of them!
Anything else?
No response
The text was updated successfully, but these errors were encountered: