-
Notifications
You must be signed in to change notification settings - Fork 39.3k
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
add --concurrent-horizontal-pod-autoscaler-syncs
flag to kube-controller-manager
#108501
Conversation
Hi @zroubalik. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
You should add |
Good catch, fixed in 95612b5 PTAL |
/remove-sig api-machinery |
/ok-to-test |
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.
/approve
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.
@zroubalik I would like to see that the feature improves the recalculation speed. There is a qps-limit that also can be a bottle-neck when using multiple HPAs.
Could you please provide some benchmarks/measurements that show the improvement? I'm asking that because the change introduces additional complexity to the algorithm and it's debbugability, so a justification that the feature is useful would be great!
Unfortunately I don't have any specific numbers, but as you can see on the linked issues, there are users facing exactly this kind of problem.
given that there are several shared objects in the controller that have to be locked and introduce contention between the workers, the benchmarks to show the actual impact of this still seems like a good idea
I also noted places where the current locking is not safely protecting against races, which also indicates more test coverage is needed
I extended the test a little bit, now it also access I run the test serveral times, it reconciles
PTAL |
Since the test stubs calls to api-server (including metrics-server) it cannot discover bottlenecks like qps-limit or other coming from how the system behaves as a whole. I think the best way to measure the improvement would be to run a comparison in a large cluster – the promise of this feature is to make HPA reconcile faster in large clusters. Creating a large cluster for tests would be costly though. Perhaps you can emulate the performance problem in a smaller cluster, by simulating a high latency of a custom metrics backend – that's another use case where we expect to see better results after this change (#96242). You could e.g. configure a http://github.com/Shopify/toxiproxy sitting in front of custom metrics backend, with a |
needs gofmt run and the added unit test is failing:
|
Fixed, 5000 HPAs was too optimistic number for this infra, so it has fallen into timeout trap. |
…oller-manager Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, mwielgus, pbetkier, zroubalik 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 |
…quest !873) 1.20:移植1.26支持多个HPAControlller worker add `--concurrent-horizontal-pod-autoscaler-syncs` flag to kube-controller-manager 为满足作业帮需求,移植PR:kubernetes#108501
Signed-off-by: Zbynek Roubalik zroubalik@gmail.com
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
While many other controllers like deployment have flag
--concurrent-xxx-syncs
to set the number of workers, the HPA controller doesn't and just hardcoded with 1 worker. It is very slow to deal with a large number of HPAs in the cluster. This PR exports a flag--concurrent-horizontal-pod-autoscaler-syncs
with the default value of5
for the HPA controller.Which issue(s) this PR fixes:
Fixes #96242
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: