Skip to content

[rate-limiting plugin] How can we add multiple limit_by conditions for the same entity? #7241

Answered by kikito
TVenuMadhav asked this question in Help
Discussion options

You must be logged in to vote

There is only one config value admitted per plugin, and each of the fields of the rate-limiting plugin admit only one value (second must be an integer, minute must be an integer, and so on).

The message Multiple limits can be configured means that it is possible to simultaneously use (for example) the minute and the second field. In your case, given that you wanted it to happen every 30 and 80 minutes, you could do this:

- name: rate-limiting
    config:
      day: null
      fault_tolerant: true
      hide_client_headers: false
      hour: null
      limit_by: ip
      second: 1800
      minute: 80
      month: null
      policy: local
      redis_database: 0
      redis_host: null
     …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by guanlan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
2 participants
Converted from issue

This discussion was converted from issue #7142 on May 26, 2021 21:23.