dimon-v opened a new issue, #11299: URL: https://github.com/apache/apisix/issues/11299
### Current Behavior When using OpenResty Limit Req, Set the rate to 200 Burst setting 1, after using WRK stress testing, I calculated that the number of 200 status entries in the access log is less than the rate ( see https://github.com/bingoohuang/blog/issues/209%EF%BC%89 lua_shared_dict my_limit_req_store 100m; server { listen 8700; default_type text/html; location / { return 200 OK; } location /limit { access_by_lua_block { local limit_req = require "resty.limit.req" -- 限制每秒 200 个请求 (rate),以及 100 的等待队列 (burst), 超过每次 300,直接拒绝 local rate = tonumber(ngx.var.arg_rate or 200) local burst = tonumber(ngx.var.arg_burst or 100) local lim, err = limit_req.new("my_limit_req_store", rate, burst) if not lim then ngx.log(ngx.ERR, "failed to instantiate a resty.limit.req object: ", err) return ngx.exit(500) end -- 以远端IP为限制 key local delay, excess = lim:incoming(ngx.var.binary_remote_addr, true) if excess == "rejected" then ngx.status = 503 return ngx.exit(503) end ngx.say("OK delay: ", delay, ", rate: ", rate, ", burst: ", burst, ", excess: ", excess) return ngx.exit(200) } } } ### Expected Behavior _No response_ ### Error Logs _No response_ ### Steps to Reproduce 1、run apisix and set route with limit-req 2、use wrk testing 3、grep access log count ### Environment - APISIX version (run `apisix version`): 3.8.1 - Operating system (run `uname -a`): 3.10.0-1160.31.1.el7.x86_64 #1 SMP Thu Jun 10 13:32:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): nginx version: openresty/1.21.4.2 built by gcc 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC) built with OpenSSL 3.2.0 23 Nov 2023 - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): {"id":"66356a45-bcc5-4a5a-9318-210342728ebd","hostname":"nginx-gray02","version":"3.8.1","boot_time":1716876699,"etcd_version":"unknown"} - APISIX Dashboard version, if relevant: - Plugin runner version, for issues related to plugin runners: - LuaRocks version, for installation issues (run `luarocks --version`): -- 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]
