You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "fleashiro (via GitHub)" <gi...@apache.org> on 2023/05/16 11:04:50 UTC

[GitHub] [apisix] fleashiro opened a new issue, #9491: docs: confusing description about limit-req's configuration

fleashiro opened a new issue, #9491:
URL: https://github.com/apache/apisix/issues/9491

   ### Current State
   
   Confusing description between `limit-req`'s en doc and zh doc. 
   
   From [en doc](https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/limit-req.md#example-usage), it gives a example that rate is 1 and burst is 3, and the description below
   ```
   If the number of requests is greater than 1 but less than 3, a delay will be added. And if the number of requests per second exceeds 3, it will be rejected.
   ```
   which means the max limit is equal to the burst value, when exceeds it, new request will be rejected.
   
   But from the [zh doc](https://github.com/apache/apisix/blob/master/docs/zh/latest/plugins/limit-req.md#%E5%9C%A8-route-%E6%88%96-service-%E4%B8%8A%E5%90%AF%E7%94%A8%E6%8F%92%E4%BB%B6), rate + burst is the limit.  
   ```
   上述示例表示,APISIX 将客户端的 IP 地址作为限制请求速率的条件,当请求速率小于 3 次每秒(`rate`)时,请求正常;当请求速率大于 3 次每秒(`rate`),小于 5 次每秒(`rate + burst`)时,将会对超出部分的请求进行延迟处理;当请求速率大于 5 次每秒(`rate + burst`)时,超出规定数量的请求将返回 HTTP 状态码 `503`
   ``` 
   And from [resty-limit-req](https://github.com/openresty/lua-resty-limit-traffic/blob/master/lib/resty/limit/req.md?plain=1#L46-L48), it seems that the zh doc is correct.
   ```
   -- limit the requests under 200 req/sec with a burst of 100 req/sec,
   -- that is, we delay requests under 300 req/sec and above 200
   -- req/sec, and reject any requests exceeding 300 req/sec.
   local lim, err = limit_req.new("my_limit_req_store", 200, 100)
   ```
   
   BTW, why the docs are different?
   
   
   
   ### Desired State
   
   Correct description about `limit-req`'s 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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

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


[GitHub] [apisix] fleashiro commented on issue #9491: docs: confusing description about limit-req's configuration

Posted by "fleashiro (via GitHub)" <gi...@apache.org>.
fleashiro commented on issue #9491:
URL: https://github.com/apache/apisix/issues/9491#issuecomment-1549462006

   Just find that the value 3 of burst is defined for a consumer. My mistake.


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


[GitHub] [apisix] fleashiro closed issue #9491: docs: confusing description about limit-req's configuration

Posted by "fleashiro (via GitHub)" <gi...@apache.org>.
fleashiro closed issue #9491: docs: confusing description about limit-req's configuration 
URL: https://github.com/apache/apisix/issues/9491


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