“Increase performance of RAILS Application”

rails, Uncategorized

Minimize HTTP Requests

– combine CSS and JS files with the :cache option

– use CSS Sprites

– avoid HTTP 302 redirects

– replace full HTTP requests by XHR requests (i.e. Ajax calls)

Minimize Database Requests

– Optimize queries, eager loading of associations with :include and JOIN

– use Rails caching: action, page and fragment caching, Memcache is an option

– use caching with timed-based expiration for dynamic content

– group operations in a transaction

– use counter cache columns

– denormalize (e.g. comma-separated list of ids in single fields to cache queries)

– precalculate data through rake tasks

– use a Sphinx search server for searching

Minimize Response Size

– SELECT only the needed columns

– LIMIT the number of return datasets (pagination)

Minimize Framework Activity

– use direct links instead of linkto or urlfor to avoid routing

– avoid dynamic finders like Model.findby*.

Minimize Database Activity

– use secondary indices for your database (Rails won’t do this for you)

– increase SQL-Server query cache

– Benchmarking

– Profiling



– ASSET packager

– SSL only where required

– Caching (Action, Fragment, Active Record)

– Migrating to Rails 3 and Ruby 1.9.2

– Image caching (if possible)

– Use Redis to check

– Add Benchmarks

– Cache option enabled for Js and CSS

– Replace HTTP to XHR where ever possible

– Eager Loading, use include and join

– CSS sprites

– Counter Cache

– Indexing

– Pre Calc large Data using Rake

– Sphinx Search

– Select only those fields required

– New Relic

– Rails Log Analyser

– Ruby Prof

– Load Less SQL queries

– Dont use Before Filters for large data


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s