HTTP load balancing algorithm

Bob Ippolito bob at
Tue Jan 23 00:21:59 MSK 2007

On 1/22/07, Ezra Zygmuntowicz <ezmobius at> wrote:
> On Jan 22, 2007, at 12:43 PM, Jonathan Vanasco wrote:
> >
> > On Jan 22, 2007, at 3:28 PM, Igor Sysoev wrote:
> >
> >> I do not know ROR and Mongrel, but as I understand you may try
> >> to route slow requests to the dedicated backends:
> >
> > that's what I thought of too, and you can do that with any proxy
> > ( though i prefer nginx )
> >
> > i'd be deathly scared of running a loadbalancer that automagically
> > handled slow/fast requests the way you expect.  the configuration
> > would be a nightmare, and it would be doing so much logging and
> > profiling of request timings, it might negate the purpose of a load
> > balancer to begin with.
> >
> >
> > // Jonathan Vanasco
>         The ideal way that nginx's proxy could work best for rails/mongrel
> backends would be an optional proxy setting for not sending a request
> to a backend until said backend returns from a request.

That's the same as having a connection limit of 1.

Optimal load balancing is a hard problem and is highly dependent on
the application and what it does. Another solution would be to send
out a barrage of "pings" (e.g. a HEAD request) to servers that have a
connection already and see which ones respond and weight them
according to that. Such a solution might also detect dead servers (and
also find servers when they come back from the dead).


More information about the nginx mailing list