Ruby on Rails Caching Benchmarks

Posted by Max Dunn Wed, 13 Sep 2006 00:56:00 GMT

I have been working on optimizing my Ruby on Rails wiki so that it can stand up under heavy load. The first step I took was to implement caching so that the pages don’t need to be re-rendered each time. This is especially important in my wiki since each page can have 6 different sections that need to be rendered:

  1. header
  2. menu
  3. footer
  4. left column
  5. middle column
  6. right column.

I did some quick benchmarks that might be useful for others that are optimizing their RoR apps:

Caching Method   Page Load Time   Pages per Second
None 620ms 1.6
Action 270ms 3.7
Page 18ms 55

These times were produced with the web load testing program The Grinder on my Averatec AMD 2800+ laptop using WEBrick running Windows XP and Rails in development mode.

The main conclusion is that while utilizing Action caching doubled the performance, using Page caching increased the performance over 30 times!

Posted in  | no comments

Comments

(leave url/email »)

   Comment Markup Help Preview comment