Welcome! Log In Create A New Profile


Request limit calculation

John Smith
June 20, 2015 02:48AM
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!
nginx mailing list
Subject Author Posted

Request limit calculation

John Smith June 20, 2015 02:48AM

Re: Request limit calculation

Maxim Dounin June 21, 2015 09:00AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 87
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready