httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snacktime <snackt...@gmail.com>
Subject creating new lbmethod for mod_proxy_balancer
Date Mon, 25 Sep 2006 06:20:18 GMT
I have very little C programming experience, but I've decided to
tackle adding another load balancing method to mod_proxy_balancer.
The reason for a new lbmethod is to have something that works nicely
with ruby on rails.  Both ruby and rails are not thread safe, which
poses certain challenges.  Right now the most popular way of hosting
rails apps is using Mongrel http://mongrel.rubyforge.org/.  Mongrel is
a simple http server which loads and runs rails, but it can only
process one request at a time due to rails not being thread safe.  So
a fairly good way to serve up rails is to have a cluster of mongrels
behind apache using balancer.  The problem is when you have a mix of
short requests with longer requests.  Mongrel will queue up
connections but can only service one at a time, so one mongrel might
have several slow requests queued up, and another mongrel might only
be serving one request.

So, what I'm trying to do is implement a new lbmethod that will only
proxy a request to a balance member that has no requests currently
being processed.  If there are no more balance members available, I'm
thinking the best thing is to implement a short wait cycle until a
free mongrel is available, and possibly log a warning so you know that
you need to add more mongrels to the cluster, and more balance members
to apache.

Any advice or hints are more then welcome, especially if for whatever
reason this is going to get really complicated.

Chris

Mime
View raw message