I\'m getting close to deploying an application built on Rails 3.1.x and started running some performance tests. After fiddling with ab
for a bit, I\'m seeing some
There are some pretty low-hanging fruit that almost always yield pretty worthy performance gains:
include
and join
where appropriate, and make sure you're using empty?
over any?
where possible to avoid SELECT
s when you just need a COUNT
.You need to be careful not to spend too much time optimizing Ruby routines. Unless you're doing something with a huge amount of data or processing (e.g. image resizing) you probably won't see very significant gains from optimizing loops or minimizing memory usage. And if you find certain pages are problematic, dig into your logs and see what is happening during those requests.
And if you're not already, autoscaling applications like HireFireApp are great for letting you handle loads of requests by scaling horizontally without the cost of running extraneous dynos during slow periods.
PS: There is a new Heroku Add-On called Blitz that lets you test a concurrent load of up to 5,000 users.