# Nginx-ey-balancer (Engine Yard patch to Nginx for max\_connections upstream)

**URL:** <https://www.ruby-forum.com/t/nginx-ey-balancer-engine-yard-patch-to-nginx-for-max-connections-upstream/194663>\
**Category:** NGINX\
**Created:** [September 8, 2010, 6:42pm UTC](https://www.ruby-forum.com/t/nginx-ey-balancer-engine-yard-patch-to-nginx-for-max-connections-upstream/194663 "2010-09-08T18:42:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlangevin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8e8cbc/32.png) [@jlangevin](https://www.ruby-forum.com/u/jlangevin)\
**Post date:** [September 8, 2010, 6:42pm UTC](https://www.ruby-forum.com/t/nginx-ey-balancer-engine-yard-patch-to-nginx-for-max-connections-upstream/194663/1 "2010-09-08T18:42:07Z")

</div>

So apparently Engine Y. has a patch for Nginx, called  
nginx-ey-balancer, to add a max\_connections directive for connections  
being passed upstream.  
The patch is to fix issues such as Mongrel backend servers being dropped  
by Nginx (at least, that’s my understanding).

I searched the forums, though, didn’t see any mention of it.

Is Igor aware of this patch, and is this needed in Nginx for anyone  
using the proxy module?  
(Our backend is nginx+php-fpm, w/ nginx reverse proxy on frontend, and  
will be using the load balancer in the near future).

[http://github.com/ry/nginx-ey-balancer](http://github.com/ry/nginx-ey-balancer)

[quote]haproxy maxconn for nginx  
Adds a request queue to Nginx that allows the limiting of concurrent  
requests  
passed to the upstream. “max\_connections N;” in an upstream directive  
means  
that each upstream server will be given N request at a time, per Nginx  
worker. For example, if you have two workers and “max\_connections 1;”  
then  
there will be a total of 2 requests at a time on each upstream server.

Some benchmarks: [http://four.livejournal.com/955976.html](http://four.livejournal.com/955976.html)

Usage:

upstream mongrels {  
server 127.0.0.1:8001;  
server 127.0.0.1:8002;  
max\_connections 1;  
}[/quote]

Posted at Nginx Forum:

> **[Nginx-ey-balancer (Engine Yard patch to Nginx for max\_connections upstream)](https://forum.nginx.org/read.php?2,128486,128486#msg-128486)**
>
> So apparently Engine Yard has a patch for Nginx, called nginx-ey-balancer, to add a max\_connections directive for connections being passed upstream. The patch is to fix issues such as Mongrel backend servers being dropped by Nginx (at least, that's...

---

<div class="post-metadata">

**Author:** ![jlangevin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8e8cbc/32.png) [@jlangevin](https://www.ruby-forum.com/u/jlangevin)\
**Post date:** [September 8, 2010, 7:14pm UTC](https://www.ruby-forum.com/t/nginx-ey-balancer-engine-yard-patch-to-nginx-for-max-connections-upstream/194663/2 "2010-09-08T19:14:20Z")

</div>

On Wed, 2010-09-08 at 12:40 -0400, jlangevin wrote:

> So apparently Engine Y. has a patch for Nginx, called  
> nginx-ey-balancer, to add a max\_connections directive for connections  
> being passed upstream.  
> The patch is to fix issues such as Mongrel backend servers being dropped  
> by Nginx (at least, that’s my understanding).

Not exactly. The issue being solved is that Rails can only handle a  
single request at a time. If you don’t use Rails then this patch is  
probably of little use to you.

> I searched the forums, though, didn’t see any mention of it.
> 
> Is Igor aware of this patch, and is this needed in Nginx for anyone  
> using the proxy module?  
> (Our backend is nginx+php-fpm, w/ nginx reverse proxy on frontend, and  
> will be using the load balancer in the near future).

FPM has adaptive spawning which is probably what you want.

Cliff
