views:

36

answers:

2

What is the recommended server layout for a production Rails application that is expected to receive medium (not heavy, but not light either) traffic? I'm thinking of a setup running Apache and Passenger (mod_rails). How many application servers, web servers, and database servers make sense? How should they be set up to provide redundancy, failover, reliability, etc.?

I know this is a broad question that depends on a lot of factors, but I'm just looking for general advice and suggestions for how this should be approached.

+1  A: 

I highly recommend going with Heroku. Let it host the app for you and turn up the dial when you need more workers.

Jesse Wolgamott
If you can make your application fit into the restrictions imposed by services like heroku/EY I would highly recommend it.
David Lyod
Cool service. I'm looking at something that needs to be hosted locally, though.
jrdioko
@jrdioko: Do you mean you are going to host it in your own machine?
jpartogi
@jpartogi: Sorry for the ambiguity. I'm thinking of a case where an application that serves a business function needs to be hosted on the business's servers as opposed to with a third-party.
jrdioko
+1  A: 

Passenger and Apache or Nginx are great starting points.

The rest basically depends on your budget and requirements and are essentially impossible to give a canned response on.

A single server is a good place to start, and you will probably be surprised by the volume of traffic a single decently spec'd box with the right tuning can turn over.

If you have budget for two servers, a splitting the web server and database is the next logical step.

Toby Hede
I see. You wouldn't happen to have any hard numbers on "the volume of traffic a single decently spec'd box with the right tuning can turn over," would you (in terms of real-world examples)?
jrdioko
Again, that's totally going to depend on you app. Install RPM, do some tests. Last year I had an app on a 1gb slice doing up to 40 req/sec without really trying. Some more complex areas of the site took that down to about 20-30 req/sec but that was more than enough for our expected load.
Toby Hede