# Limit requests per resource

**URL:** <https://www.ruby-forum.com/t/limit-requests-per-resource/212772>\
**Category:** NGINX\
**Created:** [October 13, 2011, 3:54pm UTC](https://www.ruby-forum.com/t/limit-requests-per-resource/212772 "2011-10-13T15:54:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [October 13, 2011, 3:54pm UTC](https://www.ruby-forum.com/t/limit-requests-per-resource/212772/1 "2011-10-13T15:54:18Z")

</div>

Hi, is there a way to limit the number of concurent requests per  
resource (eg. maximum 3 requests / backend, others waiting on  
frontend)?

---

<div class="post-metadata">

**Author:** ![Calin\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@Calin\_D](https://www.ruby-forum.com/u/Calin_D)\
**Post date:** [October 13, 2011, 5:07pm UTC](https://www.ruby-forum.com/t/limit-requests-per-resource/212772/2 "2011-10-13T17:07:15Z")

</div>

You can use limit req module: [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpLimitReqModule)  
.

On Thu, Oct 13, 2011 at 9:53 PM, Calin D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi, is there a way to limit the number of concurent requests per  
> resource (eg. maximum 3 requests / backend, others waiting on  
> frontend)?
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

–  
douban:www.douban.com/people/mustang/

blog: www.pagefault.info

twitter: [www.twitter.com/minibobo](http://www.twitter.com/minibobo)

weibo: [Sina Visitor System](http://www.weibo.com/diaoliang)

---

<div class="post-metadata">

**Author:** ![Calin\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@Calin\_D](https://www.ruby-forum.com/u/Calin_D)\
**Post date:** [October 14, 2011, 3:10am UTC](https://www.ruby-forum.com/t/limit-requests-per-resource/212772/3 "2011-10-14T03:10:13Z")

</div>

I think what Calin want is limit the concurrent request number to URI  
not from remote ip

I don’t know whether " limit\_req\_zone $uri zone=one:10m rate=1r/s; "  
can achieve this.

2011/10/13 Simon L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Calin\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@Calin\_D](https://www.ruby-forum.com/u/Calin_D)\
**Post date:** [March 25, 2012, 7:06pm UTC](https://www.ruby-forum.com/t/limit-requests-per-resource/212772/4 "2012-03-25T19:06:59Z")

</div>

Extended description of HttpLimitZoneModule and HttpLimitReqModule usage  
with examples and how to exclude a whitelist of IPs can be found here

> **[Limit requests per IP on Nginx using HttpLimitZoneModule and...](https://gadelkareem.com/2012/03/25/limit-requests-per-ip-on-nginx-using-httplimitzonemodule-and-httplimitreqmodule-except-whitelist/)**
>
> – Make sure to check Nginx, PHP posts for information on Nginx and PHP setup and configuration. Nginx offers two modules, HttpLimitReqModule and HttpLimitZoneModule, to limit simultaneous connections for the...

---

<div class="post-metadata">

**Author:** ![Calin\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@Calin\_D](https://www.ruby-forum.com/u/Calin_D)\
**Post date:** [October 14, 2011, 10:14pm UTC](https://www.ruby-forum.com/t/limit-requests-per-resource/212772/5 "2011-10-14T22:14:59Z")

</div>

> **[limit\_conn + queue](https://forum.nginx.org/read.php?10,214474)**
>
> Hi, I'd really like to see similar queue mechanism in limit\_conn such as in limit\_req\_rate with burst + delay option. What it really does is wait before throwing an 503 error before queue reaches certain number (allowed burst). That behavior would be...

Posted at Nginx Forum:

> **[Re: Limit requests per resource](https://forum.nginx.org/read.php?2,216652,216714#msg-216714)**
>
> Hi, is there a way to limit the number of concurent requests per resource (eg. maximum 3 requests / backend, others waiting on frontend)? \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ nginx mailing list nginx@nginx.org...

---

<div class="post-metadata">

**Author:** ![Calin\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@Calin\_D](https://www.ruby-forum.com/u/Calin_D)\
**Post date:** [March 25, 2012, 7:16pm UTC](https://www.ruby-forum.com/t/limit-requests-per-resource/212772/6 "2012-03-25T19:16:18Z")

</div>

Extended description of HttpLimitZoneModule and HttpLimitReqModule usage  
with examples and how to exclude a whitelist of IPs can be found here

> **[Limit requests per IP on Nginx using HttpLimitZoneModule and...](https://gadelkareem.com/2012/03/25/limit-requests-per-ip-on-nginx-using-httplimitzonemodule-and-httplimitreqmodule-except-whitelist/)**
>
> – Make sure to check Nginx, PHP posts for information on Nginx and PHP setup and configuration. Nginx offers two modules, HttpLimitReqModule and HttpLimitZoneModule, to limit simultaneous connections for the...

Posted at Nginx Forum:

> **[Re: Limit requests per resource](https://forum.nginx.org/read.php?2,216652,224351#msg-224351)**
>
> Hi, is there a way to limit the number of concurent requests per resource (eg. maximum 3 requests / backend, others waiting on frontend)? \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ nginx mailing list nginx@nginx.org...
