You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/12/23 09:34:31 UTC
[GitHub] [apisix] leslie-tsang commented on a change in pull request #5881: feat(limit-count): allow sharing counter
leslie-tsang commented on a change in pull request #5881:
URL: https://github.com/apache/apisix/pull/5881#discussion_r774437880
##########
File path: docs/zh/latest/plugins/limit-count.md
##########
@@ -112,6 +113,54 @@ curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335
你也可以通过 web 界面来完成上面的操作,先增加一个 route,然后在插件页面中添加 limit-count 插件:

+我们也支持在多个 Route 间共享同样的限流计数器。举个例子,
+
+```
+curl -i http://127.0.0.1:9080/apisix/admin/services/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+ "plugins": {
+ "limit-count": {
+ "count": 1,
+ "time_window": 60,
+ "rejected_code": 503,
+ "key": "remote_addr",
+ "group": "services_1#1640140620"
+ }
+ },
+ "upstream": {
+ "type": "roundrobin",
+ "nodes": {
+ "127.0.0.1:1980": 1
+ }
+ }
+}'
+```
+
+每个配置了 `group` 为 `services_1#1640140620` 的 Route 都将共享同一个每个 IP 地址只能访问两次的计数器。
Review comment:
```suggestion
每个配置了 `group` 为 `services_1#1640140620` 的 Route 都将共享同一个每个 IP 地址每分钟只能访问一次的计数器。
```
Would be better ?
I'm confused about the count attr of limit-count.
I don't know if I'm wrong.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org