Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Increase the default QPS and Burst value of the controller manager #1461

Conversation

iawia002
Copy link
Contributor

What this PR does / why we need it:

I found that the default QPS and Burst values for the rest-client of the kubefed-controller-manager component were configured very low(5 and 10), causing the component to start very slowly:

Waited for due to client-side throttling, not priority and fairness

So I set it to a suitable value.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 19, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @iawia002!

It looks like this is your first PR to kubernetes-sigs/kubefed 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubefed has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 19, 2021
@swiftslee
Copy link
Contributor

This issue is introduced in #1416 .
Please take a look at this pr @shiyan2016

@swiftslee
Copy link
Contributor

/cc @shiyan2016

@k8s-ci-robot
Copy link
Contributor

@yuswift: GitHub didn't allow me to request PR reviews from the following users: shiyan2016.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @shiyan2016

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.

@swiftslee
Copy link
Contributor

/cc @snowplayfire

@k8s-ci-robot
Copy link
Contributor

@yuswift: GitHub didn't allow me to request PR reviews from the following users: snowplayfire.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @snowplayfire

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.

@swiftslee
Copy link
Contributor

friendly ping @hectorj2f

@@ -100,8 +100,8 @@ member clusters and do the necessary reconciliation`,
flags.StringVar(&kubeFedConfig, "kubefed-config", "", "Path to a KubeFedConfig yaml file. Test only.")
flags.StringVar(&kubeconfig, "kubeconfig", "", "Path to a kubeconfig. Only required if out-of-cluster.")
flags.StringVar(&masterURL, "master", "", "The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.")
flags.Float32Var(&restConfigQPS, "rest-config-qps", 5.0, "Maximum QPS to the api-server from this client.")
Copy link
Contributor

Choose a reason for hiding this comment

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

These values come from https://github.com/kubernetes/client-go/blob/master/rest/config.go#L45 as any other client. I suggest you simply adapt them in your deployment to other values using the flags.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I understand that, but based on the actual situation, for the kubefed-controller-manager component, 5 and 10 are too small. For most users, it will be more convenient for us to set the default value to a more appropriate value. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

These values come from https://github.com/kubernetes/client-go/blob/master/rest/config.go#L45 as any other client. I suggest you simply adapt them in your deployment to other values using the flags.

I'm not sure if there are anyone who are using v0.8.1, after we upgraded to this version, we did encounter the slowing start up problem of controller. IMO, increasing it is necessary for the users who are using v0.8.1.

Copy link
Contributor

@xunpan xunpan Oct 25, 2021

Choose a reason for hiding this comment

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

I agree that default qps is small. We need to set a value that makes more sense to kubefed controller by default.
It is not easy to get a suitable value. I think we can refer to https://cloud.google.com/kubernetes-engine/docs/best-practices/scalability. It says Clusters larger than 500 nodes use 100 QPS client limit for both components: scheduler and controller manager. Consider kubefed is a manager of multiple clusters. I think this 100 for 500 nodes can be a value as minimum for kubefed. And burst can be double of it: 200.

So, my proposal is:

"rest-config-qps": 100 
"rest-config-burst": 200

@yuswift @hectorj2f @iawia002 what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

agree with that 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, my proposal is:

"rest-config-qps": 100 
"rest-config-burst": 200

Updated.

@iawia002 iawia002 force-pushed the update-rest-config-default-value branch from 0a8dcac to bc4afe5 Compare October 25, 2021 08:45
@xunpan
Copy link
Contributor

xunpan commented Oct 25, 2021

/test all

@k8s-ci-robot
Copy link
Contributor

@xunpan: No presubmit jobs available for kubernetes-sigs/kubefed@master

In response to this:

/test all

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.

@xunpan
Copy link
Contributor

xunpan commented Oct 25, 2021

@hectorj2f
Please help to start the testing. It seems I cannot start it.

@xunpan
Copy link
Contributor

xunpan commented Oct 27, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 27, 2021
@xunpan
Copy link
Contributor

xunpan commented Nov 16, 2021

There is no other comments. Let me merge it.
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: iawia002, xunpan

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 16, 2021
@k8s-ci-robot k8s-ci-robot merged commit 6b78e82 into kubernetes-retired:master Nov 16, 2021
@iawia002 iawia002 deleted the update-rest-config-default-value branch November 16, 2021 02:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants