[Mongrel] Design flaw? - num_processors, accept/close

Robert Mela rob at robmela.com
Tue Oct 16 11:16:35 EDT 2007

Brian Williams wrote:
> We recently ran into exactly this issue.  Some rails requests were 
> making external requests that were taking 5 minutes (networking issues 
> out of our control).  If your request got queued behind one of these 
> stuck mongrels, the experience was terrible.  I experimented with 
> adjusting the mod_proxy_balance settings to try to get it to fail over 
> to the next mongrel (I had hoped that the min,max,smax could all be 
> set to one, and force only one connection to a mongrel at a time) but 
> this didn't seem to work.
> Solution - I stuck lighttpd in between.  Lighttp has a proxying 
> algorithm that does exactly this - round robin but to worker with 
> lightest load.
Were you on Apache 2.0 or 2.2?

mod_proxy_balancer is 2.2 only.  It has the same features as lighty's 
balancer, and many important ones that it doesn't.   We had 2.0 <-> 
lighttpd <-> mongrel_cluster.  I like 2.2/mod_proxy_balancer better.   
Lighty missed some features we needed and I wasn't prepared to implement.

I made heavy use of the following logging features in Apache and m_p_b 
for diagnostics:

   -- request duration in microseconds ( lighty only offers seconds ... 
ugh )
   -- client session cookie
   -- balancer member ( which load balancer member Apache sent the 
request to )
   -- client socket status at end of request

I should correct the Round Robin misperception.    More accurately 
mod_proxy_balancer does request balancing.   The module sends an equal 
number of requests to each back end, at least according to the docs.   
It has another mode where it balances by bytes transferred.

The icing on the cake for me was mod_proxy_balancer's status page.  It 
gives a live view of configured balancer pools and stats for each pool 

> I'd love to hear that there's a way to use mod_proxy_balancer, but I 
> couldn't get to work.
> --Brian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rob.vcf
Type: text/x-vcard
Size: 116 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20071016/a48d8be0/attachment.vcf 

More information about the Mongrel-users mailing list