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

request help: share limit counter between routes #5342

Closed
spacewander opened this issue Oct 27, 2021 · 1 comment · Fixed by #5881
Closed

request help: share limit counter between routes #5342

spacewander opened this issue Oct 27, 2021 · 1 comment · Fixed by #5881
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@spacewander
Copy link
Member

Issue description

To do this, you need to specify the key of the route's corresponding limit-count in lrucache so that the same limit object is shared across multiple routes. lrucache keys (hereafter called groups to distinguish them from limit keys) are currently generated automatically, ensuring that each route's group is independent. For this change, we need to be able to specify the group in the limit-count.

"limit-count": {
            "group": "group_id_blah"
            "count": 2,
            "time_window": 60,
            "rejected_code": 503,
            "key": "remote_addr"
}

Note that the configuration of the same group needs to be the same, which currently needs to be guaranteed by the caller, otherwise the limit object obtained by the group will be different from the configuration.

Environment

  • apisix version (cmd: apisix version): 2.10.1
  • OS (cmd: uname -a):
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V):
  • etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
  • apisix-dashboard version, if have:
  • the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
  • luarocks version, if the issue is about installation (cmd: luarocks --version):
@spacewander spacewander added enhancement New feature or request good first issue Good for newcomers labels Oct 27, 2021
@lanbiaowan
Copy link

i will take this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants