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

Introduce ratelimiter flags #1399

Merged
merged 1 commit into from
Mar 3, 2022

Conversation

pigletfly
Copy link
Contributor

@pigletfly pigletfly commented Feb 25, 2022

Signed-off-by: pigletfly wangbing.adam@gmail.com

What type of PR is this?
/kind feature

What this PR does / why we need it:

introduce flags for user to tune ratelimiter

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-controller-manager`: Introduced several flags to specify controller's capacities:
- --rate-limiter-base-delay
- --rate-limiter-max-delay
- --rate-limiter-qps
- --rate-limiter-bucket-size

@karmada-bot karmada-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Feb 25, 2022
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 25, 2022
@pigletfly pigletfly changed the title introduce ratelimiter flags Introduce ratelimiter flags Feb 25, 2022
@pigletfly pigletfly force-pushed the add-ratelimiter-flags branch from aa031df to 3c7f2bf Compare February 25, 2022 08:25
@RainbowMango
Copy link
Member

why we need it?

@pigletfly pigletfly force-pushed the add-ratelimiter-flags branch from 3c7f2bf to 0fbba97 Compare February 25, 2022 08:48
@pigletfly
Copy link
Contributor Author

because the DefaultControllerRateLimiter in client-go https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/util/workqueue/default_rate_limiters.go#L39-L45, default option is 10 qps and 100 bucket size,if there are lots of object events in the cluster,although we can increase worker nums introduced in #1321, but it still can easily hit the ratelimit.

@pigletfly pigletfly force-pushed the add-ratelimiter-flags branch 2 times, most recently from 4225a12 to c8fc844 Compare February 25, 2022 09:07
@pigletfly pigletfly force-pushed the add-ratelimiter-flags branch from c8fc844 to fe15714 Compare February 28, 2022 07:19
@karmada-bot karmada-bot 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 Feb 28, 2022
@pigletfly pigletfly force-pushed the add-ratelimiter-flags branch 2 times, most recently from cd7bc35 to 15d8c31 Compare February 28, 2022 07:50
@pigletfly
Copy link
Contributor Author

@RainbowMango PTAL

@RainbowMango
Copy link
Member

OK. Scheduled to tomorrow.

@pigletfly pigletfly force-pushed the add-ratelimiter-flags branch from 15d8c31 to 3791766 Compare March 2, 2022 08:21
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good.
Please @Garrybest take a look.
This patch just focus on karmada-controller-manager, and no changes to karmada-agent.

I'll tidy up some stuff(like flag name, comments) if I have time later.

pkg/util/worker.go Outdated Show resolved Hide resolved
pkg/util/worker.go Show resolved Hide resolved
pkg/util/worker.go Show resolved Hide resolved
@pigletfly pigletfly force-pushed the add-ratelimiter-flags branch from 3791766 to 14ec5f9 Compare March 3, 2022 08:08
Signed-off-by: pigletfly <wangbing.adam@gmail.com>
@pigletfly pigletfly force-pushed the add-ratelimiter-flags branch from 14ec5f9 to 9e28d6c Compare March 3, 2022 08:09
@Garrybest
Copy link
Member

/assign

@Garrybest
Copy link
Member

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 3, 2022
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 3, 2022
@karmada-bot karmada-bot merged commit f3b1142 into karmada-io:master Mar 3, 2022
@RainbowMango
Copy link
Member

/remove-kind cleanup
/kind feature

@karmada-bot karmada-bot added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Mar 3, 2022
@pigletfly pigletfly deleted the add-ratelimiter-flags branch March 3, 2022 10:36
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

4 participants