# Mongrel Clusters on Windows

**URL:** <https://www.ruby-forum.com/t/mongrel-clusters-on-windows/91229>\
**Category:** Rails\
**Created:** [April 5, 2007, 8:12pm UTC](https://www.ruby-forum.com/t/mongrel-clusters-on-windows/91229 "2007-04-05T20:12:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aginghipster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9c0ed/32.png) [@aginghipster](https://www.ruby-forum.com/u/aginghipster)\
**Post date:** [April 5, 2007, 8:12pm UTC](https://www.ruby-forum.com/t/mongrel-clusters-on-windows/91229/1 "2007-04-05T20:12:11Z")

</div>

I have set-up mongrel clusters by individual steps. What I mean by this  
is that I tried to use mongrel\_clusters plugin and failed.

Using mongrel clusters I did:

mongrel\_rails cluster::configure -e development \ -p 8200 -N 3 -c  
C:\a\_public\_xyz\webside -a 127.0.0.1

This worked but the next step failed:

mongrel\_rails cluster::start

I have read on some posts that mongrel clusters is not supported on  
windows (Windows 2000 in my case)

So I have done the following individual steps, and everything works.

mongrel\_rails service::install -N app\_C1 -c C:\a\_public\_xyz\webside -p  
8201 -e development

I did this for a further 2 ports, 8202 and 8203

Then I started the services manually i.e. net start app\_C1

then in my apache httpd.conf file I added:

dont worry about my name [wibble.com](http://wibble.com), it is only on my PC, that is not on  
the net.

\<Proxy balancer://wibblecluster\>  
BalancerMember [http://127.0.0.1:8201](http://127.0.0.1:8201)  
BalancerMember [http://127.0.0.1:8202](http://127.0.0.1:8202)  
BalancerMember [http://127.0.0.1:8203](http://127.0.0.1:8203)

\<VirtualHost \*:80\>  
ServerName [wibble.com](http://wibble.com)

ProxyPass / balancer://wibblecluster/  
ProxyPassReverse / balancer://wibblecluster/  
ProxyPreserveHost on  
  
\<Location /balancer-manager\>  
SetHandler balancer-manager

I restart apache, and I can run my rails app 100%

My question is what am I missing from not using mongrel cluster plugin.

Is there any downside to what I have done.

I know that I need to start all the mongrel and apache services  
automatically when windows starts.

At the moment windows is my only option, I don’t want \*nix, unless I am  
really forced to it.

I read on a post that mongrel clusters after version 1 will be  
deprecated is this correct?

What are the long term plans for having rails served by multiple  
servers?

Andrew

---

<div class="post-metadata">

**Author:** ![aginghipster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9c0ed/32.png) [@aginghipster](https://www.ruby-forum.com/u/aginghipster)\
**Post date:** [April 6, 2007, 7:29am UTC](https://www.ruby-forum.com/t/mongrel-clusters-on-windows/91229/2 "2007-04-06T07:29:11Z")

</div>

Andrew C. wrote:

> I have set-up mongrel clusters by individual steps. What I mean by this  
> is that I tried to use mongrel\_clusters plugin and failed.
> 
> Using mongrel clusters I did:
> 
> mongrel\_rails cluster::configure -e development \ -p 8200 -N 3 -c  
> C:\a\_public\_xyz\webside -a 127.0.0.1
> 
> This worked but the next step failed:
> 
> mongrel\_rails cluster::start
> 
> I have read on some posts that mongrel clusters is not supported on  
> windows (Windows 2000 in my case)

Yes, mongrel\_cluster relies on daemonize functionality, only available  
on \*nix platforms.

Also, there ins’t a “serviceable” mongrel\_cluster (run it as windows  
service) so couldn’t be configured to start with windows automatically.

> So I have done the following individual steps, and everything works.
> 
> mongrel\_rails service::install -N app\_C1 -c C:\a\_public\_xyz\webside -p  
> 8201 -e development
> 
> I did this for a further 2 ports, 8202 and 8203
> 
> Then I started the services manually i.e. net start app\_C1
> 
> then in my apache httpd.conf file I added:
> 
> dont worry about my name [wibble.com](http://wibble.com), it is only on my PC, that is not on  
> the net.
> 
> \<Proxy balancer://wibblecluster\>  
> BalancerMember [http://127.0.0.1:8201](http://127.0.0.1:8201)  
> BalancerMember [http://127.0.0.1:8202](http://127.0.0.1:8202)  
> BalancerMember [http://127.0.0.1:8203](http://127.0.0.1:8203)
> 
> \<VirtualHost \*:80\>  
> ServerName [wibble.com](http://wibble.com)
> 
> ProxyPass / balancer://wibblecluster/  
> ProxyPassReverse / balancer://wibblecluster/  
> ProxyPreserveHost on  
>   
> \<Location /balancer-manager\>  
> SetHandler balancer-manager
> 
> I restart apache, and I can run my rails app 100%
> 
> My question is what am I missing from not using mongrel cluster plugin.

Nothing, mongrel\_cluster is just a shortcut (on \*nix platforms) to do  
the same things, also impersonating the process (change user and group,  
something know on Windows Log On with Account in Services Manager).

Also, at no cost, you get a lightweight, simple process monitoring that  
will respawn each mongrel\_service if the ruby process dies (something  
that I have seen happens, more than I wanted to).

> Is there any downside to what I have done.

Take notice that you’re setting all your mongrels to run in development  
mode, unless thats what you want, please use production to get better  
results.

Besides that, everything seems ok.

> I know that I need to start all the mongrel and apache services  
> automatically when windows starts.

That is a question? or just a rethoric?

> At the moment windows is my only option, I don’t want \*nix, unless I am  
> really forced to it.
> 
> I read on a post that mongrel clusters after version 1 will be  
> deprecated is this correct?

Well, that was part of the idea with Zed, but still no plans when this  
will happen.

> What are the long term plans for having rails served by multiple  
> servers?

What do you mean by this? Serve the same application from multiple  
computers?

If so, you need to configure your Apache balancer to point secondary  
computer IP:PORT for each mongrel running in it.

That isn’t reliable AFAIK, since application code and page/fragment  
cache must be shared to get a good performance in production.

---

<div class="post-metadata">

**Author:** ![aginghipster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9c0ed/32.png) [@aginghipster](https://www.ruby-forum.com/u/aginghipster)\
**Post date:** [April 6, 2007, 10:39am UTC](https://www.ruby-forum.com/t/mongrel-clusters-on-windows/91229/3 "2007-04-06T10:39:47Z")

</div>

Luis,

I was thinking about what I had done last night and came to the  
conclusion that it was the process monitoring and the automatic restarts  
that I was missing. The example I gave you was my test in a development  
environment, obviously I would change for Production.

I am a Windows developer myself, but am thinking of moving to \*nix, but  
my client is windows so I have to fit in with their systems. But the  
lack of a resilient mongrel cluster on windows may force my client to  
nix, this is a hard one for me as I had not expected mongrel clusters to  
be ‘unavailable’ on windows. Maybe next time I set-up the desired  
environment first then develop the system.

Thanks Andrew

---

<div class="post-metadata">

**Author:** ![aginghipster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9c0ed/32.png) [@aginghipster](https://www.ruby-forum.com/u/aginghipster)\
**Post date:** [April 6, 2007, 3:37pm UTC](https://www.ruby-forum.com/t/mongrel-clusters-on-windows/91229/4 "2007-04-06T15:37:53Z")

</div>

Andrew C. wrote:

> Luis,
> 
> I was thinking about what I had done last night and came to the  
> conclusion that it was the process monitoring and the automatic restarts  
> that I was missing. The example I gave you was my test in a development  
> environment, obviously I would change for Production.

Err, the process monitoring and automatic restart is part of  
mongrel\_service and not mongrel\_cluster I must correct.

On \*nix, you need to fall into external monitoring solutions (monit came  
to my mind).

> I am a Windows developer myself, but am thinking of moving to \*nix, but  
> my client is windows so I have to fit in with their systems. But the  
> lack of a resilient mongrel cluster on windows may force my client to  
> nix, this is a hard one for me as I had not expected mongrel clusters to  
> be ‘unavailable’ on windows. Maybe next time I set-up the desired  
> environment first then develop the system.

I understand what you feel about this, but I, as windows developer,  
deploy most of the time under windows (for the same reason as you).

I created mongrel\_service to ease deploying of Rails under Windows, not  
to dismiss everyone’s attempts and force them to switch to \*nix.

The cluster, by itself is just a wrapper around several mongrel\_rails  
start -p BASE\_PORT + n, where n is the iteration of the cluster member  
(2 servers: BASE\_PORT + 0, BASE\_PORT + 1).

In that escense, don’t differ from mongrel\_service.

A few problems around mongrel\_cluster came to my mind right now, often  
associated with pid files and restarting individual members of the  
cluster.

I have plans to provide same functionality of clusters as 1, single  
service under service manager, but more important things are priority:

# Logging (since no mongrel or service under windows log its results

into log/mongrel.log)

# Correct path quotation and command line parsing (since often you

install Ruby into C:\Program Files, which have spaces in the path).

# YAML configuration parsing, instad of rely on mongrel\_rails (this will

faster cluster functionality for services).

Anyway, nor Windows, Mongrel, mongrel\_service or mongrel\_cluster are  
perfect. If you find something that doesn’t work (or not as expected),  
just dig into the code and patch 🙂

Thats the beauty of OSS 🙂

> Thanks Andrew

Good luck,

Luis L.  
Multimedia systems
