Welcome! Log In Create A New Profile

Advanced

HttpLimitReq Module not blocking every request?

March 30, 2011 07:26AM
Hello,

I am trying to understand how the HttpLimitReq Module works. I have read that it uses the Leaky Bucket Algorithm, however I am not sure how to understand the behaviour I am observing. Here is my test setup:

limit_req_zone $binary_remote_addr zone=one:10m rate=1r/m;
location /test {
limit_req zone=one nodelay;
}

Every resource under /test should be accessible only once per minute - is that right?

Now I have set up a test script to download a file from /test every second and I get the following results:
success
blocked
blocked
blocked
blocked
success
...
So every fifth request is coming through, so In total I get 12 successful requests and 48 blocked request per minute. However, from the rate setting I would expect to have only one successful download and 59 blocked requested.

Can anyone explain why this is happening? Also is there a way to configure nginx to show the behaviour I am expecting?

Thank you for your help!

Best regards,
Jonas Kaufmann
Subject Author Posted

HttpLimitReq Module not blocking every request?

j0nes2k March 30, 2011 07:26AM

Re: HttpLimitReq Module not blocking every request?

Maxim Dounin March 30, 2011 08:24AM

Re: HttpLimitReq Module not blocking every request?

j0nes2k March 30, 2011 08:57AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 218
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready