views:

701

answers:

4

I am actually developing and application that has around 15 modules, all of them using the same database.

I am using Apache + Mongrel, I cannot use Passenger because I am working on Windows (please forgive me for this deadly sin!)

Which of the following is a better approach?

  1. Deploy multiple small rails applications using a virtual server and a pair of mongrels for each application.
  2. Deploy only a big rails application

I am worried about the number of running mongrels and the memory/cpu load.

+1  A: 

It depends on hwo many simultaneous clients you expect to have. One mongrel, one client at a time (until Rails 2.2) since Rails isn't currently threaded.

Two is enough mongrels if you don't expect more than a few simultaneous users. You can raise that number by using page caching to bypass mongrel for pages that don't have user-specific dynamic content.

The only way to be truly sure is to test the system.

In my experience you'll need at least 4 mongrels for a moderately active site of just a few users at a time.

Otto
+2  A: 

I'd suggest deploying a monolithic Rails application.

I use the request_routing plugin to drive 3 domains sharing the same database from one, big Rails application.

I'm running 4 mongrels, which seems to be enough for now, but YMMV.

Can Berk Güder
A: 

It sounds like it would be a much better use of your hardware to integrate all modules into one comprehensive rails apps.

IMHO the primary weakness of Rails is the amount of resources needed to run a low or very low traffic app. On the other hand a few mongrels go a long way to serve a whole lot of traffic.

allesklar
+1  A: 

It would seem like one application would best fit your scenario... as others have said...

A good rule of thumb would be that the average behaving mongrel will consume 60mb of memory (or less)... take your total RAM available, subtract out for any other services (database, memcache, etc) and then figure out how many pieces of the pie you can have left from the remaining memory.

You can always scale them up or down from there...

whoisjake