How much traffic have you handled and what was the architecture like?
What have you had to deal with and what was your setup?
What have you had to deal with and what was your setup?
The key is knowing where the bottlenecks lie and what gives you the greatest gains for the least amount of optimizations.
Run unicorn for your rails apps. It runs in a master/worker setup in which the master distributes the requests to workers. Benchmarks have shown it to be much faster than competitors. In saying that you may want to look into phusion passenger lite 3.0. I have not seen any clear benchmarks against unicorn so I cannot give a definitive answer but have heard good things.
Make sure static content is not being proxied through to your rails apps. You'll be wasting request processing on js,css,jpeg and gif in rails where it could be done by apache, lighttpd, nginx or even varnish if you'll levelled in some caching. A bigger advantage to that is to serve the static content from a second domain from a different web server so that parallel connections are made to retrieve that content.
Enable caching in rails so that classes, views, etc are in memory. It'll help to not have to reload a class or view every time a request is made.
Look to find the most efficient templating engine for rails. Erb was 3 times slower than erubis last time I checked.
Are you IO or cpu bound? Run top and vmstat. If you are IO bound then cpu utilization will be lower and its most likely wait on the db. This could be for any number of reasons. Rails is notorious for selecting everything. Limit your queries, select on fields that are required. Index columns that are used in your where clauses and on join fields. If your entire dataset does not fit into the buffer pool then your mysql might be hitting disk which is orders of magnitude slower than ram.
Set noatime on all your servers so that file access times are not updated, huge performance differences. Can be done on your database server too.
I hope some of that helps.
Check out http://newrelic.com - We have a week-long free trial of our premium service and a forever-free version with less features as well.
As far as what architecture/infrastructure is required to support certain levels of traffic, it really depends. However, the faster your app, the fewer app instances you need to serve a given amount of traffic.