hectorsq
hectorsq

Reputation: 76986

Multiple rail apps using Apache and Mongrel

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.

Upvotes: 1

Views: 1054

Answers (4)

whoisjake
whoisjake

Reputation: 622

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...

Upvotes: 1

allesklar
allesklar

Reputation: 9590

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.

Upvotes: 0

Can Berk Güder
Can Berk Güder

Reputation: 113310

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.

Upvotes: 2

Otto
Otto

Reputation: 19331

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.

Upvotes: 1

Related Questions