[Mongrel] load balancers and mongrel

Luis Lavena luislavena at gmail.com
Fri Oct 26 20:46:59 EDT 2007


On 10/26/07, Andrew Arrow <andrew at geni.com> wrote:
> We have a load balancer sending requests to one of X boxes and one of
> N mongrel processes on that box.
>
> Since each mongrel processes is multi-threaded but it has a mutex
> around the section that calls rails, we end up with several requests
> queued up waiting  when they could have gone to another box with a
> free process.
>
> For example, boxA, and boxB.
>
> boxA has mongrels 1 through 10
> boxB has mongrels 11 through 20
>
> Load balancer sends a request to boxA mongrel 5.
> Load balancer sends a request to boxB mongrel 12.
> Load balancer sends a request to boxA mongrel 5 again.
> It has to wait for the 1st request still running on boxA mongrel 5.
>
> How can we help the load balancer know it should have sent the
> request to any number of other free mongrels vs. queuing up threads
> that have to wait?
>

That's the bad logic of your balancer.

If it's a hardware one, check if there are some algorithms you can tweak.

For a software-based one, check the configuration file if there is
some param about spreading / distributing the requests.

Also, could be helpful if you mix the box A and box B list of members
for the cluster:

A: 192.168.0.15
B: 192.168.0.16

A-mongrel1
B-mongrel11
A-mongrel2
B-mongrel12

etc...

-- 
Luis Lavena
Multimedia systems
-
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi


More information about the Mongrel-users mailing list