Current limiting plugin
rate-limiting
1.Create a current limiting plug-in
istestBasicAuth Thisapicreate flow restriction rules.
Plugin configuration:
ConfigurationRedis host. Example: 127.0.0.1:6379
Configurable items:
year: year
< span>month: month
day: day
< /span>minute: minutes, here we configure 3, which means that no more than 3 calls per minute.
Second: seconds p>
Calculation frequency dimension: month/day< span class="s4">/ minutes / seconds, If multiple dimensions are configured at the same time, they will take effect at the same time .
2.Verification
Verification: request within one minute, the fourth time, an error is reported
span>{
“message”: “API rate limit exceeded”
}
< h2>3.Description
According to year, month, day, Set current limit rules in hours, minutes, and seconds, and multiple limits will take effect at the same time.
For example: no more than 10 calls per day, and no more than 3 per minute Second-rate.
When there are more than 3 visits within one minute, an error will be reported the fourth time.
When the number of visits exceeds 10 times in a day, an error will be reported the eleventh time.