Fair Proxy Balancer

Alexander Staubo alex at purefiction.net
Fri Nov 23 02:07:04 MSK 2007

On 11/22/07, Janko Hauser <jh at zscout.de> wrote:
> Am 22.11.2007 um 22:38 schrieb Adam Zell:
> > In case people haven't seen it:
> >   http://www.brainspl.at/articles/2007/11/09/a-fair-proxy-balancer-
> > for-nginx-and-mongrel
> Great news, this will be a huge step also for the case of Zope zeo-
> deployments.

Great news indeed. We recently switched from Lighttpd to Nginx using
this patch on a live site (20 mongrels across two boxes, load average
~3.0), and it seems completely stable.

> One question, how is the busy state determined? In case
> of zeo each backend client can take some defined number of requests
> in parallel, how is such a case handled?

I have not studied the sources, but I expect it will pick the upstream
with the fewest number of current pending requests; among upstreams
with the same number of concurrent requests, the one picked is
probably arbitrary.

> (Not knowing mongrels, are
> they taking only one request each?)

Mongrel supports multiple concurrent requests, but uses Ruby's green
threads (which I like to think are closer to yellow and shaped like a
banana) to process them.

The Mongrel Rails dispatcher uses a single process-wide lock around
the dispatching logic, meaning that a single Mongrel-Rails process can
only process on request at a time.


More information about the nginx mailing list