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
remove client QPS limit #95825
remove client QPS limit #95825
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. I understand the commands that are listed here. |
Welcome @chensheng0! |
Hi @chensheng0. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: chensheng0 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
43d7c92
to
89b3831
Compare
/assign @DirectXMan12 |
The rate limiter can be adjusted by code level integrations and many commands have flags that can specify these values. The ratelimiter itself has worked well and as intended in our code. The max inflight doesn't prioritize requests, so a single accidental actor can still flood the apiserver and this helps. Rather than remove this, your code could choose to disable it (or maybe you have a bug and want it on?) or perhaps you could make the implementation of the ratelimiter more efficient. /hold |
The point is the default behavior of the client whether to limit qps or not. For stability, it should limit. But the problem we mostly may encounter as the fact is many developers will ignore the qps limit and cause a series of problems just like goroutines' leak. @aojea also mentioned rate limit in openshift/origin#25606. So how about add some tips in client-go's readme or other place to let developers notice that? |
Absolutely agree with @deads2k |
Any guidelines of docs, maybe I can do some work ^_^ |
FWIW, depending on how you use the client, 5 QPS is rather low, and it's generally not obvious to end-users that client-side throttling is occurring. We've had several users hit this issue, and had to manually raise the default in CR, just like controller-manager does. I'm not certain about removing the limit entirely, but the fact that: a) controller-manager doesn't use the default, IIRC suggests that maybe the default or the defaulting strategy is not the best |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Recently we are using client-go in my cloud server in which we will interact with k8s cluster. When there are a lot of requests reached our server, we will allocate one goroutine per request. In the request we will use client in client-go to invoke k8s apiserver. After a while, we found a lot of goroutines got stucked in
r.tryThrottle()
in Do() and in result caused goroutines' leak in our server.The QPS limit of client will influence client-go's performance, how about using no rate limiting when new a client ?
As API Server has already had --max-mutating-requests-inflight and --max-requests-inflight to prevent API Server overload from client requests, and API Server use this client in most scenes when client request is accepted. So I think we should remove this client QPS limit to raise client-go's concurrency.
Otherwise many developer will get stuck on this bug.
This pr is similar to the same bug of apiserver. #80465
Which issue(s) this PR fixes:
just same as the bug mentioned in #78766
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.