jagerzhang opened a new issue #4760:
URL: https://github.com/apache/apisix/issues/4760


   Issue description
   希望`limit-count`可以支持对不同的`route_id`或`service_id`设置不同的限速阈值。比如,对比现有版本功能的改变:
   
   当前版本功能:只能针对某个固定`key`来限速
   ```
   "limit-count": {
         "count": 10,
         "key": "service_id",
         "policy": "local",
         "rejected_code": 503,
         "time_window": 1
       }
   ```
   
   
如下所示,希望可以在指定`apisix`对象限速的基础上,支持更精细化的限速设置,即可以针对不同的`apisix`对象来设置不同的`count`和`time_window`:
   ```
   "limit-count": {
         "by": "service_id",     # 选择需要限速的类型,one of ["remote_addr", 
"server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name", 
"service_id", "route_id"],希望还可以新增一个route_id
         "policy": "local",
         "rejected_code": 503,
         "limit_config": {          # 针对不同的apisix对象设置不同的限速阈值
             "service_A": {
                       "time_window": 1,
                       "count": 10
             },
             "service_B": {
                       "time_window": 60,
                       "count": 300
              }
             # more ..
         }
       }
   ```
   
   插件文档:https://apisix.apache.org/docs/apisix/plugins/limit-count/
   
   Environment
   基于官方最新docker镜像部署。
   
   apisix version (cmd: apisix version): 2.8
   OS (cmd: uname -a): centos7
   OpenResty / Nginx version (cmd: nginx -V or openresty -V): openresty/1.19.3.2
   etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to 
get the info from server-info API): 3.3.4
   apisix-dashboard version, if have: 2.7
   luarocks version, if the issue is about installation (cmd: luarocks 
--version): null


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to