# Limit issue, i think it's a bug

**URL:** <https://www.ruby-forum.com/t/limit-issue-i-think-its-a-bug/179493>\
**Category:** NGINX\
**Created:** [November 26, 2009, 9:23am UTC](https://www.ruby-forum.com/t/limit-issue-i-think-its-a-bug/179493 "2009-11-26T09:23:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![websun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d07c76/32.png) [@websun](https://www.ruby-forum.com/u/websun)\
**Post date:** [November 26, 2009, 9:23am UTC](https://www.ruby-forum.com/t/limit-issue-i-think-its-a-bug/179493/1 "2009-11-26T09:23:48Z")

</div>

I have:

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

```

in http zone.

whatever changes I make ot that directive even if I set 100/s won’t  
serve more than 2 requests per second.

maybe Im doing it wrong?

Posted at Nginx Forum:

> **[limit issue, i think it's a bug](https://forum.nginx.org/read.php?2,25729,25729#msg-25729)**
>
> I have: limit\_req\_zone $binary\_remote\_addr zone=one:10m rate=5r/s; limit\_req zone=one burst=5; in http zone. whatever changes I make ot that directive even if I set 100/s won't serve more than 2 requests per second.

---

<div class="post-metadata">

**Author:** ![websun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d07c76/32.png) [@websun](https://www.ruby-forum.com/u/websun)\
**Post date:** [November 26, 2011, 11:04am UTC](https://www.ruby-forum.com/t/limit-issue-i-think-its-a-bug/179493/2 "2011-11-26T11:04:13Z")

</div>

I realize this is a two-year-old topic, but I’m having the same issue.  
It doesn’t matter what I have the rate set to, it only allows about 2  
requests per second. This is my config:

in http:  
limit\_req\_zone $binary\_remote\_addr zone=flood:10m rate=15r/s;

in server location:  
limit\_req zone=flood;

That should really be all that is necessary, right? I’m using Nginx  
1.1.6.

Posted at Nginx Forum:

> **[Re: limit issue, i think it's a bug](https://forum.nginx.org/read.php?2,25729,219093#msg-219093)**
>
> I have: limit\_req\_zone $binary\_remote\_addr zone=one:10m rate=5r/s; limit\_req zone=one burst=5; in http zone. whatever changes I make ot that directive even if I set 100/s won't serve more than 2 requests per second.

---

<div class="post-metadata">

**Author:** ![websun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d07c76/32.png) [@websun](https://www.ruby-forum.com/u/websun)\
**Post date:** [November 26, 2011, 11:40am UTC](https://www.ruby-forum.com/t/limit-issue-i-think-its-a-bug/179493/3 "2011-11-26T11:40:08Z")

</div>

Hello!

On Sat, Nov 26, 2011 at 05:03:24AM -0500, talisto wrote:

> That should really be all that is necessary, right? I’m using Nginx  
> 1.1.6.

How do you test it?

Maxim D.

---

<div class="post-metadata">

**Author:** ![websun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d07c76/32.png) [@websun](https://www.ruby-forum.com/u/websun)\
**Post date:** [November 26, 2011, 2:22pm UTC](https://www.ruby-forum.com/t/limit-issue-i-think-its-a-bug/179493/4 "2011-11-26T14:22:10Z")

</div>

On Sat, Nov 26, 2011 at 5:03 AM, talisto [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> That should really be all that is necessary, right? I’m using Nginx  
> 1.1.6.

> Maxim D. Wrote:  
> How do you test it?

> I’ve been testing it with Siege, but I can actually generate error 503  
> responses just by refreshing my web browser fast enough. My results  
> with Siege are somewhat random; sometimes the very first request fails,  
> then a couple will pass, then another will fail, all within a couple  
> seconds. That’s with my rate set to 15r/s, which should be more than  
> enough.. in Siege I’m only using 5 concurrent users with 1 request per  
> second, yet it still fails, often on the first or second hit. In my  
> browser, it’s a bit more reliable; I have a simple page which makes 2  
> ajax requests; the 2nd ajax request will always fail.

> As soon as I remove the limit\_req line, I can flood my server with as  
> many requests as Siege can handle and it never generates a 503, so I  
> know that the errors aren’t being caused by something else. I’m not  
> sure why the limit\_req isn’t working properly though.

You are truncating your response. Don’t top post or do that, it makes  
it difficult to track things or for us to help you.

From a review of the documentation this is by design.  
Siege with 5 concurrent users at 1r/s could easily exceed 15r/s if  
there is other traffic or if it is not behaving predictably.  
Are you sure there are no other requests to the site, and that the  
browser test only makes 2 requests, and that siege only sends 10  
requests? We need logs.  
From what you have sent, you will get 503 because you are limiting the  
requests and have not defined burst. Set burst to nodelay and see if  
it allows 15/s.  
And you cannot claim bug without evidence; please see the DEBUG  
README, show relevant configuration, define limit\_req\_log\_level  
correctly, and send the output.

Stefan C.

> **[ScaleEngine is the Technical Video Streaming CDN Delivering Perfect Streams...](https://www.scaleengine.com/contact)**
>
> Video CDN, streaming live and on demand securely and reliably. Perfect streams to the world with our developer API, exact usage billing, and direct support

“People who enjoy having meetings should never be allowed to be in  
charge of anything.”

---

<div class="post-metadata">

**Author:** ![websun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d07c76/32.png) [@websun](https://www.ruby-forum.com/u/websun)\
**Post date:** [November 26, 2011, 9:28pm UTC](https://www.ruby-forum.com/t/limit-issue-i-think-its-a-bug/179493/5 "2011-11-26T21:28:58Z")

</div>

Hello!

On Sat, Nov 26, 2011 at 07:22:51AM -0500, talisto wrote:

> browser, it’s a bit more reliable; I have a simple page which makes 2  
> ajax requests; the 2nd ajax request will always fail.
> 
> As soon as I remove the limit\_req line, I can flood my server with as  
> many requests as Siege can handle and it never generates a 503, so I  
> know that the errors aren’t being caused by something else. I’m not  
> sure why the limit\_req isn’t working properly though.

The limit\_req is expected to generate 503 as soon it sees more  
requests than burst set. As you have no burst set, it will  
generate 503 as soon as it sees requests coming with less than  
1/15 second interval. This is expected behaviour.

While flooding your your server with requests (with limit\_req  
set), you should see about 15 successfull requests per second,  
others will return 503.

Maxim D.

---

<div class="post-metadata">

**Author:** ![websun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d07c76/32.png) [@websun](https://www.ruby-forum.com/u/websun)\
**Post date:** [November 26, 2011, 1:23pm UTC](https://www.ruby-forum.com/t/limit-issue-i-think-its-a-bug/179493/6 "2011-11-26T13:23:16Z")

</div>

Maxim D. Wrote:

> How do you test it?

I’ve been testing it with Siege, but I can actually generate error 503  
responses just by refreshing my web browser fast enough. My results  
with Siege are somewhat random; sometimes the very first request fails,  
then a couple will pass, then another will fail, all within a couple  
seconds. That’s with my rate set to 15r/s, which should be more than  
enough.. in Siege I’m only using 5 concurrent users with 1 request per  
second, yet it still fails, often on the first or second hit. In my  
browser, it’s a bit more reliable; I have a simple page which makes 2  
ajax requests; the 2nd ajax request will always fail.

As soon as I remove the limit\_req line, I can flood my server with as  
many requests as Siege can handle and it never generates a 503, so I  
know that the errors aren’t being caused by something else. I’m not  
sure why the limit\_req isn’t working properly though.

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,25729,219104#msg-219104](http://forum.nginx.org/read.php?2,25729,219104#msg-219104)
