0

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.

jrdioko
  • 32,230
  • 28
  • 81
  • 120

2 Answers2

1

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
  • 40,197
  • 4
  • 83
  • 109
  • If you can make your application fit into the restrictions imposed by services like heroku/EY I would highly recommend it. – David Lyod Sep 23 '10 at 19:57
  • Cool service. I'm looking at something that needs to be hosted locally, though. – jrdioko Sep 23 '10 at 21:23
  • @jrdioko: Do you mean you are going to host it in your own machine? – Joshua Partogi Sep 23 '10 at 22:03
  • @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 Sep 24 '10 at 17:40
1

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
  • 36,755
  • 28
  • 133
  • 162
  • 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 Sep 24 '10 at 17:48
  • 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 Sep 25 '10 at 05:08