Posts Tagged: performance



Rails Performance Tip: Query Optimization

 by Anand  on   11 Jul 2011

Rails applications will get significant performance boost if the sql queries sent to the database are optimized. Database cialis super active must not be hit with requests unless there is an absolute necessity.

Two Basic online writing sites steps for Optimization:

  1. Add database indexes on all foreign keys
  2. add_index :tasks, :project_id
  3. Use Eager loading to avoid n+1 query problems, in sensible places.
  4. Project.find(12).includes(:tasks, :notes)

    QueryReviewer gem:

This gem helps a lot in optimizing the SQL queries.

For every page request, it gives good statistics on the number of queries, number of slow queries, in-efficient queries etc.,
Check it out.



Prelude

In the previous article, we went through the basic architecture of Apache and Passenger. Now I’ve been told that its a bit too much to digest in one shot but it’ll all make sense when all the 3 articles are read together. If not, you’re always welcome to drop a question in the comments section and I’d be happy to help.

Assumptions

In this article, we will be looking at the primary directives in Apache and Passenger for optimization. The rest of the series is specific to the case where a single RoR application is running on the server (say, TweakMyApp).

Continue reading →