questions about limit_req_zone, what's the difference between rate= and burst=

fhal meteor8488 at 163.com
Thu Jul 19 07:34:09 UTC 2012


 Hi All,

According to NGINX wiki,

limit_req_zone  $binary_remote_addr  zone=one:10m   rate=1r/s;
 
    server {
        location /search/ {
            limit_req   zone=one  burst=5;
        }

means  allows a user no more than 1 request per second on average, with bursts of no more than 5 requests.

But what's the difference between rate= and burst=?
For example,

limit_req_zone  $binary_remote_addr  zone=one:10m   rate=1r/s;
limit_req   zone=one  burst=5;

limit_req_zone  $binary_remote_addr  zone=one:10m   rate=5r/s;
limit_req   zone=one  burst=1;

What's the difference between above code? From my understanding, for both settings, users can establish no more than 6 requests at the same time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120719/b137ce27/attachment.html>


More information about the nginx mailing list