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/04/07 12:57:27 UTC

[GitHub] [apisix] riskgod opened a new issue #4002: bug: limit-req not works in version 2.5

riskgod opened a new issue #4002:
URL: https://github.com/apache/apisix/issues/4002


   ### Issue description
   hey, I test this in version 2.3, but in 2.5, the plugin not works. follow the official docs
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] riskgod commented on issue #4002: bug: limit-req not works in version 2.5

Posted by GitBox <gi...@apache.org>.
riskgod commented on issue #4002:
URL: https://github.com/apache/apisix/issues/4002#issuecomment-815492170


   > > "limit-req": {
   > > "rate": 1,
   > > "burst": 1,
   > > "rejected_code": 503,
   > > "key": "remote_addr"
   > > }
   > 
   > You try to set the `burst` field of the limit-req plugin configured on the route to 0, and then test it again, like this:
   > 
   > ```
   > "limit-req": {
   >             "rate": 1,
   >             "burst": 0,
   >             "rejected_code": 503,
   >             "key": "remote_addr"
   >         }
   > ```
   
   S
   <img width="655" alt="Screen Shot 2021-04-08 at 14 37 32" src="https://user-images.githubusercontent.com/3436287/113979665-2047b580-9878-11eb-8f3f-53ca0e20a3e9.png">
   till return 200
   
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] riskgod edited a comment on issue #4002: bug: limit-req not works in version 2.5

Posted by GitBox <gi...@apache.org>.
riskgod edited a comment on issue #4002:
URL: https://github.com/apache/apisix/issues/4002#issuecomment-815492170


   > > "limit-req": {
   > > "rate": 1,
   > > "burst": 1,
   > > "rejected_code": 503,
   > > "key": "remote_addr"
   > > }
   > 
   > You try to set the `burst` field of the limit-req plugin configured on the route to 0, and then test it again, like this:
   > 
   > ```
   > "limit-req": {
   >             "rate": 1,
   >             "burst": 0,
   >             "rejected_code": 503,
   >             "key": "remote_addr"
   >         }
   > ```
   
   <img width="655" alt="Screen Shot 2021-04-08 at 14 37 32" src="https://user-images.githubusercontent.com/3436287/113979665-2047b580-9878-11eb-8f3f-53ca0e20a3e9.png">
   till return 200
   
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Firstsawyou edited a comment on issue #4002: bug: limit-req not works in version 2.5

Posted by GitBox <gi...@apache.org>.
Firstsawyou edited a comment on issue #4002:
URL: https://github.com/apache/apisix/issues/4002#issuecomment-814923471


   It is best to provide steps to reproduce, so as to facilitate troubleshooting.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Firstsawyou commented on issue #4002: bug: limit-req not works in version 2.5

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #4002:
URL: https://github.com/apache/apisix/issues/4002#issuecomment-814923471


   It is best to provide the next minimum reproduction steps, so that it is convenient to troubleshoot the problem.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Firstsawyou commented on issue #4002: bug: limit-req not works in version 2.5

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #4002:
URL: https://github.com/apache/apisix/issues/4002#issuecomment-815409161


   Maybe the request rate per second does not reach the threshold, you can try to request multiple times per second.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] riskgod closed issue #4002: bug: limit-req not works in version 2.5

Posted by GitBox <gi...@apache.org>.
riskgod closed issue #4002:
URL: https://github.com/apache/apisix/issues/4002


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] riskgod commented on issue #4002: bug: limit-req not works in version 2.5

Posted by GitBox <gi...@apache.org>.
riskgod commented on issue #4002:
URL: https://github.com/apache/apisix/issues/4002#issuecomment-815416366


   > Maybe the request rate per second does not reach the threshold, you can try to request multiple times per second.
   ####  Thank you for nice recommendation, but it still return 200 20 times. 
   ```
   for i in `seq 1 20`; do curl http://127.0.0.1:9080/testgrpc9?name=world -H 'apikey: auth-one' -i; done
   ```
   <img width="995" alt="Screen Shot 2021-04-08 at 11 20 32" src="https://user-images.githubusercontent.com/3436287/113963622-7c044580-985c-11eb-82e6-0bb28037d0fe.png">
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Firstsawyou commented on issue #4002: bug: limit-req not works in version 2.5

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #4002:
URL: https://github.com/apache/apisix/issues/4002#issuecomment-815510007


   > #### Still return 200
   
   The key-auth plugin is enabled in your current routing, you need to set the `burst` field of the limit-req plugin enabled in `consumer` to `0`. Because burst is not `0`, requests per second with a request rate greater than `rate` and less than `rate + burst` will be delayed. In this way, according to your loop request command, the limit-req plugin threshold is not actually reached.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] riskgod edited a comment on issue #4002: bug: limit-req not works in version 2.5

Posted by GitBox <gi...@apache.org>.
riskgod edited a comment on issue #4002:
URL: https://github.com/apache/apisix/issues/4002#issuecomment-815492170


   > > "limit-req": {
   > > "rate": 1,
   > > "burst": 1,
   > > "rejected_code": 503,
   > > "key": "remote_addr"
   > > }
   > 
   > You try to set the `burst` field of the limit-req plugin configured on the route to 0, and then test it again, like this:
   > 
   > ```
   > "limit-req": {
   >             "rate": 1,
   >             "burst": 0,
   >             "rejected_code": 503,
   >             "key": "remote_addr"
   >         }
   > ```
   #### Still return 200
   <img width="655" alt="Screen Shot 2021-04-08 at 14 37 32" src="https://user-images.githubusercontent.com/3436287/113979665-2047b580-9878-11eb-8f3f-53ca0e20a3e9.png">
   
   
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Firstsawyou commented on issue #4002: bug: limit-req not works in version 2.5

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #4002:
URL: https://github.com/apache/apisix/issues/4002#issuecomment-815481032


   > "limit-req": {
   >             "rate": 1,
   >             "burst": 1,
   >             "rejected_code": 503,
   >             "key": "remote_addr"
   >         }
   
   You try to set the `burst` field of the limit-req plugin configured on the route to 0, and then test it again, like this:
   
   ```
   "limit-req": {
               "rate": 1,
               "burst": 0,
               "rejected_code": 503,
               "key": "remote_addr"
           }
   ```
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] riskgod commented on issue #4002: bug: limit-req not works in version 2.5

Posted by GitBox <gi...@apache.org>.
riskgod commented on issue #4002:
URL: https://github.com/apache/apisix/issues/4002#issuecomment-815390432


   
   #### I have set a auth-key named jack and the key is auth-one 
   ```
   {
      "action":"get",
      "node":{
         "key":"\/apisix\/consumers",
         "dir":true,
         "nodes":[
            {
               "modifiedIndex":60,
               "createdIndex":45,
               "value":{
                  "update_time":1617799994,
                  "create_time":1617796052,
                  "username":"jack",
                  "plugins":{
                     "key-auth":{
                        "key":"auth-one"
                     },
                     "limit-req":{
                        "key":"consumer_name",
                        "rejected_code":403,
                        "disable":false,
                        "rate":1,
                        "burst":0
                     }
                  },
                  "id":"jack"
               },
               "key":"\/apisix\/consumers\/jack"
            },
            {
               "modifiedIndex":43,
               "createdIndex":43,
               "value":{
                  "update_time":1617788738,
                  "create_time":1617788738,
                  "username":"jack_auth",
                  "plugins":{
                     "key-auth":{
                        "key":"auth-jack",
                        "disable":false
                     },
                     "limit-req":{
                        "key":"consumer_name",
                        "rejected_code":403,
                        "disable":false,
                        "rate":1,
                        "burst":1
                     }
                  },
                  "id":"jack_auth"
               },
               "key":"\/apisix\/consumers\/jack_auth"
            }
         ]
      },
      "count":"3"
   }
   ```
   
    #### So I init a new router now, enable the limit-req.
   ```
   curl http://127.0.0.1:9180/apisix/admin/routes/115 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "methods": ["GET"],
       "uri": "/testgrpc9",
       "plugins": {
           "grpc-transcode": {
               "proto_id": "1",
               "service": "helloworld.Greeter",
               "method": "SayHello"
           },
           "limit-req": {
               "rate": 1,
               "burst": 1,
               "rejected_code": 503,
               "key": "remote_addr"
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "taie-address-service.taie.svc.cluster.local:8081": 1
           }
       }
   }'
   
   ```
   #### I call this in several times hopes it return 503 or 403,  but it always return 200
   ```
   $ curl http://127.0.0.1:9080/testgrpc9?name=world -H 'apikey: auth-one' -i
   ```
   <img width="794" alt="Screen Shot 2021-04-08 at 09 58 48" src="https://user-images.githubusercontent.com/3436287/113956990-0646ac80-9851-11eb-93e1-f9adfdcb7a6f.png">
   
   
   
   
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org