Tools for Monitoring Performance in Ruby on Rails Application

Tools for Monitoring Performance in Ruby on Rails Application

Here are some tips for you to monitor performance in a Ruby on Rails application. Some tools and tips are equally applicable for other web applications:

1. Rails Logger
The simplest way to get information about performance is to analyze rails log. It will provide you information of the time spent processing each request, broken down into rendering and SQL time. You can also find whether a particular part are cached or the occurrence of cache expiry.

2. Rails Performance Test - Profiling
Profiling helps you to see the details of a performance test and provide an in-depth picture of the slow and memory hungry parts. Each test case is run 1 time in profiling mode.

3. Rails Performance Test - Benchmarking
Through Rails performance test, source of application’s memory or speed bottleneck and can be found. Benchmarking helps find out how fast each performance test runs. Each test case is run 4 times in benchmarking mode.

4. Rails Analyzer
The Rails Analyzer project contains a collection of tools (The Production Log Analyzer, The Action Profiler, Rails Analyzer Tools, The SQL Dependency Grapher) for Rails that let you discover biggest slow spots in your applications allowing you to best focus optimization efforts.

5. Rails Footnote
It is a rails plugin which displays footnotes in your application for easy debugging, such as sessions, request parameters, cookies, filter chain, routes, queries, etc. Even more, it contains links to open files directly in your editor including your backtrace lines.

6. Query Reviewer
Query Reviewer is an advanced SQL query analyzer. It generates a page with explanation output of all SELECT queries, rate a page’s SQL usage, display interactive summary on page.

7. Slim Scrooge
SlimScrooge is an optimization layer to ensure your application only fetches the database content needed to minimize wire traffic, excessive SQL queries and reduce conversion overheads to native Ruby types.
SlimScrooge implements inline query optimization, automatically restricting the columns fetched based on what was used during previous passes through the same part of your code.

8. New Relic
New Relic is the all-in-one web application performance tool that lets you see performance from the end user experience down to the line of application code. It will also list the errors if such occurrence occur.

9. Rack-Bug
It is a debugging toolbar for Rack applications implemented as middleware.

10. Sidekiq
Sidekiq uses threads to handle many jobs at the same time in the same process. It does not require Rails but will integrate tightly with Rails 3/4 to make background processing dead simple.

11. Firebug
Firebug is a firefox plugin and a very powerful tool. Apart from many outstanding features, it helps to monitor network performance. You can see the load time of each files (when they started to load and when they are completed), filter it by type (e.g. javascript or CSS) and examining http headers.

So far so good, you can suggest more. These are a mere introduction. You can try those out and examine the health of your application. I have a plan to write another one with tips regarding enhancing performance based on the generated health report of a web application. Stay tuned for that!