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

Global ratelimiter #60

Open
xuqingyun opened this issue Mar 22, 2024 · 0 comments · Fixed by #56
Open

Global ratelimiter #60

xuqingyun opened this issue Mar 22, 2024 · 0 comments · Fixed by #56
Assignees

Comments

@xuqingyun
Copy link
Collaborator

xuqingyun commented Mar 22, 2024

Description

The current rate limiting method of KubeGateway is local rate limiting for each instance, which does not require additional dependencies and is simple to implement, but it also has some issues:

  • The quotas are inaccurate. Each gateway instance limits based on its own quota. The HTTP/2 long connections between the client and gateway may cause requests to concentrate on certain gateway instances, resulting in clients receiving less quota than the total configured rate limiting quota.

  • The precision of rate limiting thresholds is poor. When the number of gateway instances is scaled up, the total rate limiting quota for all instances increases, so it is necessary to readjust the threshold for each instance.. For requests with small rate limiting thresholds like "list," it is difficult to precisely limit the flow.

  • The round-robin load balancing strategy cannot guarantee strict balance of requests to backend apiserver instances. Even slight deviations in requests for requests like "full list" can put significant pressure on the apiserver.

To address the above issues, we can integrate a global rate limiting center to implement a global rate limiting strategy. The gateway supports both local rate limiting and integration with the rate limiting center. When the rate limiting center is unavailable, the local rate limiting capability serves as a fallback. The rate limiting center is a weak dependency of KubeGateway. During data center construction, local rate limiting capability is used first, and integration with the rate limiting center is done once its deployment is completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant