Live data from Hacker News

Advanced caching in Rails

broadcastingadam.com

1–10 of 21 posts

Re: Advanced caching in Rails

#3
The post is actually easy to read and understand. Funny thing is, in the last couple of weeks, there has been a lot of material (podcasts, posts, screencast, etc) on the subject. But it didn't really take off until 37signals mentioned it.

Re: Advanced caching in Rails

#4
post #3

The post is actually easy to read and understand. Funny thing is, in the last couple of weeks, there has been a lot of material (podcasts, posts, screencast, etc) on the subject. But it didn't really take off until 37signals mentioned it.

Is there any screencast other than the Railscasts one?

Re: Advanced caching in Rails

#5
post #3

The post is actually easy to read and understand. Funny thing is, in the last couple of weeks, there has been a lot of material (podcasts, posts, screencast, etc) on the subject. But it didn't really take off until 37signals mentioned it.

I wrote it in May. It was well received then, but it has gotten more play now since the 37 signals post on caching. IMO my guide is the definitive guide to the caching system in Rails.

I believe this is the first time it has made it to HN. I've always gotten very good feedback on it. Thanks for your comments.

Re: Advanced caching in Rails

#8
post #4
post #3

The post is actually easy to read and understand. Funny thing is, in the last couple of weeks, there has been a lot of material (podcasts, posts, screencast, etc) on the subject. But it didn't really take off until 37signals mentioned it.

Is there any screencast other than the Railscasts one?

New Relic has a series of videos on scaling Rails, several of which are about caching. They're a couple of years old but most of the concepts and method calls are still valid.

http://railslab.newrelic.com/scaling-rails

Re: Advanced caching in Rails

#9
All the time spent talking about caching in Rails avoids the real issue: generating complex html in Ruby/Rails is really slow.

My Rails sites spend 85% of the time generating HTML, the other 15% of the time is spent communicating with the db and other external services. And it's not easy to figure out where the slowness is. When I've ran performance profiles in the past, something like 50% of the time was spent in GC.

Re: Advanced caching in Rails

#10

All the time spent talking about caching in Rails avoids the real issue: generating complex html in Ruby/Rails is really slow . My Rails sites spend 85% of the time generating HTML, the other 15% of the time is spent communicating with the db and other external services. And it's not easy to figure out where the slowness is. When I've ran performance profiles in the past, something like 50% of the time was spent in G…

From experience I have to agree with both parts of this - it can be very slow and it's generally not that easy to profile, e.g. the call graph tends to get very complex and therefore difficult to interpret, and as you say, GC can be a big part of the problem which doesn't help.

One thing worth mentioning: anecdotally I've found that ActiveRecord can have an impact on performance far beyond the cost of the database queries, both by directly adding a reasonable amount of overhead and by instantiating a lot of objects internally which in turn triggers a lot of garbage collection. I wouldn't be surprised if that accounts for a fair chunk of what you're seeing.

Post reply on HN