November 16th, 2009
Just wanted to put up some useful methods for fine-tuning Rails performance. I’ve never tried all the methods in this list at once, but if you find your app bottlenecking in a particular area, here’s some fixes.
Caching
- Tips for Caching JS and CSS [technicalpickles.com]
- Page Caching [railscasts.com]
- cache_fu [github.com] – ActiveRecord memcached plugin
- cache-money [github.com] – Another ActiveRecord memcached plugin
- More Cache Plugins [agilewebdevelopment.com]
Bandwidth
- AssetPacker [synthesis.sbecker.net] – Dynamically pack JS/CSS files
- Better Output Compression [agilewebdevelopment.com] - Use GZIP to compress data being sent to browsers that can handle gzip’d data. This is not necessary if you’re behind Apache or another webserver that has this feature.
CPU & Memory
- Tips @ Joyent [wiki.joyent.com] - There aren’t too many generic ways to reduce memory usage, but this page has some tips.
- Optimize and cache. This is very specific to an individual app, but anytime you’re doing a large read-only query against data that doesn’t change much, cache it.
And finally a page similar to this post: