Hi, all,
I use limit_req module to limit QPS to my upstream, conf like this: http { limit_req_zone $request_uri zone=req_one:10m rate=10000r/s; server { ... location / { limit_req zone=req_one; } } } I use benchmarking tool to stress on one url, but only about 1000 request. I checked source code, found that: ms = (ngx_msec_int_t) (now - lr->last); excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000; if (excess < 0) { excess = 0; } *ep = excess; if ((ngx_uint_t) excess > limit->burst) { return NGX_BUSY; } At here, ms can be '0', so in a millisecond, only the first request can pass the checking. After I set burst value to (rate / 1000) in configuration file, the QPS result is expected. I'm not sure whether this is a bug or It's my fault in configuration. Thanks.
_______________________________________________ nginx-devel mailing list nginx-devel@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx-devel