What is the best Ruby on Rails setup to handle a site with low to medium traffic? Why?
-
Low traffic = tens of thousands visitors/month Medium traffic = hundreds of thousands visitors/month I am new to RoR (switching from Windows environment), so I would need more explanations on what and why choose. Let's say I am getting a blank VPS where I have to install all the stuff (operating system, web server, database server, RoR). What do you recommend for that kind of traffic? What web server? (Apache, Mongrel, WEBrick, something else?) What database? (MySQL, SQLite, something else? - I am not thinking at NoSQL databases just yet) Why you recommend what you recommend? The operating system will be Linux (Ubuntu server, for now). All above will be on the same machine. I am not thinking of going in the cloud (Heroku and such), not yet. I know that by default, for local development, RoR uses WEBrick as web server and SQLite as the database. I assume these are not the best setup for a production server which has that kind of traffic. So, far I managed to install RoR on Ubuntu and make it work locally with the default settings (WEBrick, SQLlite). I want to make it work with other settings too.
-
Answer:
Like me, you are coming from an environment with stone-age deployment, and is used to that. Forget about VPS hell and maintaining servers. With Ruby, you have Heroku, which is bloody fantasticular: http://heroku.com As for database, just use Postgres, because it's pretty darn good, but also because Heroku offers it for free. You can use pretty much everything on Heroku, but some things are easier and cheaper.
Mattias Petter Johansson at Quora Visit the source
Other answers
WIth your requirement, I also suggest that you start using heroku (http://www.heroku.com) free stack to see if it fit your needs (maybe it will, unless you plan to upgrade) I also suggest that you get familiar with Passenger (it's an Apache module built for RoR), this will help you a lot in the future. MySQL will suffice for your database as the traffic is relatively low, unless you want to write humongous SQL statements, there should be no problem at all The advantage of Heroku is that it will take care of the server setup and deployment script for you. Once you reach a certain level and is confident in you deployment skill, you can switch to an empty VPS on Amazon EC2 if you really like to customize your web server EngineYard ... well they change a lot and break my stuffs too frequently to consider
Thái Lê Huy
I second those answers. We (http://barrelrun.com) use Engineyard just because it allows for more flexibility (you get full ssh access to a "real" server), Heroku is easier to use AND has a free tier (EY does not) but you can't customize your server (in fact, you don't even get a server). I found it hard to give up on that :-) If you really want to RYO, you can't go wrong with Amazon's EC2 (which is basically what EY sits on-top off). They also offer a free tier (for 1 year at least I believe) and I have seen white-papers that claim the free tier can easily support millions of page hits/month. In this case I would go with: NGINX with Passenger -> much easier to manage and lighter than Apache, WEBrick is really only for development and I also have not used Mongrel outside of a dev instance so can't comment on it's use in a production instance. MySQL -> why not? It's free, works really nice with Rails and gives you everything you could ever want from an RDBMS (disclaimer, I work at Oracle but I used MySQL long before we acquired it). You are also right not to jump on the NoSQL bandwagon, it is a very specialized tool for a very specialized requirement, one which you probably will never have to use You gonna need a deploy tool (capistrano) and I also highly recommend a tool that helps bootstrapping your environment (Chef) I would really only resort to the RYO solution if you are a masochist that wants to learn all this stuff (I did!) otherwise, stick to the PaaS providers.
Mark Vilrokx
I feel you should definitely try to set it up once on a bare bone system. It might be a little difficult because your coming from windows but if your looking for a horizontally scaling structure then a load balancer + apache + unicorn + mysqldb is all you need. Capistrano to make releases automated and deterministic :) ... Do remember that on a bare bone box you'll have to install all the basic services as well. A great resource is this one: http://articles.slicehost.com/2009/10/15/capistrano-series-installing-apache-with-passenger-mod_rails-support Search around on all the slicehost articles on how to install all of the above. Mostly its very simple yum and apt-get commands. The big gotcha will be getting stuck for a long time on something like an apache configuration. This WILL happen and there's really no way through it except by doing it. Or a unicorn setting you didn't know about. I actually know a very big site that gets 3M hits per day using above arch on 12 different boxes. Mostly a read only site though. The second time around you'll be able to get a bare bone box up in under 1hr from scratch. And you'll be a unix guru. If however you are doing a startup and u don't have any income, then I highly recommend heroku because market risk is bigger than execution risk.
Vivek Ponnaiyan
Definitely go with heroku. You get total sclability, and zero server and sysadmin costs. Heroku is actually free -- it lets you save the salary of a sysadmin. We are currently having more than 8 million unique users a month, with 2-3 million PV/day, and I don't even know what server we are running on. And I couldn't care less. It works, it scales, and I can deploy with a git push. So we are focusing on what matters -- feature development.
Andras Kristof
Definitely start with Heroku's free tier to see if it works for your requirements. Then move to their paid tier till you get big / complicated. If you get to a point where Heroku becomes too expensive or it's not customizable enough, then you can think about the next step. But, IMHO, not for now.
Namit Yadav
I absolutely agree with Mattias Petter Johansson that you should dispense with setting all of that stuff up yourself and just use Heroku. We have used it successfully with clients who have hundreds of thousands of users. We have also used Engine Yard for many years, but they are a bit less reliable.
Lawrence Sinclair
http://engineyard.com is good, although relatively expensive. They sit on top of AWS and share deep roots in Ruby on Rails
Abir Bhattacharyya
Related Q & A:
- What is the best type of battery to have in a cordless phone?Best solution by Yahoo! Answers
- What's the best thing to do if you have a hangover?Best solution by Yahoo! Answers
- What is the best science field to go into in a college?Best solution by Yahoo! Answers
- What's the best way to get smudges off of a plasma?Best solution by Yahoo! Answers
- What is the best cables for HD setup?
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.