29. Fixing Problems
• Performance is a
moving target!
• Horizontal/
Vertical scaling
http://www.flickr.com/photos/tpapi/2765541278/
30. NewRelic Workflow
• Web Transactions
• Most Time
Consuming
• Slowest
Average
Response Time
• Database
31. And the Number One
Ruby on Rails
Performance Problem
Is ...
32. And the Number One
Ruby on Rails
Performance Problem
Is ...
N+1 Select
33. N+1 Select
photos.each do |photo|
puts photo.rating.id
puts photo.user.email
puts photo.camera.name
end
How many queries does this execute?
34. N+1 Select
photos = Photo.find(:all, :include => [:rating, :user, :email])
photos.each do |photo|
puts photo.rating.id
puts photo.user.email
puts photo.camera.name
end
How many queries does this execute?
36. Still not fast enough for
ya?
• ruby-prof
• memprof - where are objects being created
• change interpreters
• ree -- gc.enable stats
• jruby
• ruby 1.9
37. Readings
• Mark Nottingham’s HTTP caching tutorial
• http://www.mnot.net/cache_docs/
• YSlow Best Practices
• http://developer.yahoo.com/performance/rules.html
• http://delicious.com/marshall.yount/performance
39. Appendix
• The following incomplete slides were
suggested by audience members at the
Dallas Ruby Brigade. I’ll be fleshing these
out and adding them to a future version of
the presentation.