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

There should be a configure item which can set the rate limit for all single API. #5390

Closed
ferdinand026 opened this issue Aug 2, 2023 · 4 comments
Assignees

Comments

@ferdinand026
Copy link

Rationale

Limiting the API access rate can not only effectively allocate node resources, but also ensure the stable running of a node. Java-tron supports API rate limits, it only supports separately setting the rate limit of each interface, or setting a global rate limit for all APIs. But it not supports to configure one item to control all single API. Expected there is a configure item which can set the rate limit for all single API.

Why should this feature exist?

There are so many APIs provided by java-tron. if user wants to configure each API's rate limit to 10, he needs to configures interfaces one by one, which is too much work. So It would be great if there will be a single configure item like this.

@eodiandie
Copy link
Contributor

what is the relationship between the globe rate limit config and the single rate limit config? In other words, how to coordinate when both globe config and single config existed in the project, could you provide more details?

@ferdinand026
Copy link
Author

The globe rate limit setting and the single rate limit setting have been implemented by java-tron, and How is it implemented now, after adding this configure item, it is still the same, and the original logic will not be changed. The priority is not change. For example, if each API's rate limit is 100, but the global rate limit is 1000, then even the access rate of one api can reach 100, but if the global access rate has already reach 1000/s, then any access will be denied.

The reason for adding this configuration is now single rate limit setting is confiured one by one, that is so complicated. So this issue is proposed to expected one configure item can be set to modify all single APIs.

@xxo1shine
Copy link
Contributor

@ferdinand026 This is a great idea and complements the rate limiting feature.

@halibobo1205
Copy link
Contributor

Close with #5502.

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

No branches or pull requests

4 participants