[Mongrel] balancer://mongrel_cluster

Jeroen Houben jeroen at supercool.nl
Mon Sep 4 06:42:31 EDT 2006


Kris Leech wrote:
> Jeroen Houben wrote:
>
>   
>> Kris Leech wrote:
>>  
>>
>>     
>>> A couple of questions please:
>>>
>>> What is the benefit of having more than one Mongrel/Rails instance on 
>>> the same machine, could one instance not serve as many requests as say 
>>> three instances?
>>>
>>> Is Mongrel Cluster a Apache add-in (like mod_*) or a separately  running 
>>> load balancer which runs on a separate port, I could not work it out 
>>>       
>> >from the sample Apache config...
>>     
>>> |# Redirect all non-static requests to cluster
>>>  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
>>>  RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
>>>
>>> How does ||balancer://mongrel_cluster |work?
>>>  
>>>    
>>>
>>>       
>> My understanding is that one mongrel can only handle one request at a 
>> time. Therefore 3 mongrel can process 3 request simultaniously.
>>  
>>
>>     
> I see, and this is because Mongrel is not threaded, so its kind of like 
> replicating threads by using whole instances.
>   
Well I'm not entirely sure about that. I think mongrel can do threads 
but you really shouldn't use Rails with threads. 
http://david.planetargon.us/articles/2006/08/08/why-you-need-multiple-mongrel-instances-with-rails
>   
>> The balancer is a module for apache >= 2.1
>> the balancer itself is not a seperate process, the pack of mongrels of 
>> course are seperate processes.
>>  
>>
>>     
> Thanks, does it replace mod_proxy_balance?
>
>   
No balancer://mongrel_cluster *is* mod_proxy_balancer, please look at 
http://mongrel.rubyforge.org/docs/apache.html for more details.

Jeroen



More information about the Mongrel-users mailing list