Request limit calculation
John Smith
funwithnginx at yahoo.com
Sat Jun 20 06:43:57 UTC 2015
Hello, I'm John and I'm a nginx noob.
I was wondering how the request limit reach is calculated when using limit_req_zone and limit_req.My problem is that, in development, I'm not concatenating static files such as .js and .css files. And so the browser does about 27 requests when the first page is loaded. I've set up a rate of 50r/s, but out of 27, about 18 requests receive a 503 response and I don't understand why, since the rate isn't exceeded.
My config looks something like this. I have a link to this from the sites-enabled folder.
limit_req_zone $binary_remote_addr zone=one:10m rate=50r/s;
server { listen 443 ssl; ssl_certificate ...; ssl_certificate_key ...; server_name localhost; server_tokens off; gzip_types *; root ...;
limit_req zone=one;
location = / { index index.html; }
location = /index.html { ... }
location / { ... }}
If I use limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;with limit_req zone=one burst=50 nodelay;
it works OK.
I was wondering why I would have to specify a burst in order for this to work.
Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20150620/7d8192d1/attachment-0001.html>
More information about the nginx
mailing list