In this second part of a six-part article series on optimizing the performance of a Ruby-on-Rails application, you will learn how to use the Rails Analyzer tool set. This article is excerpted from chapter 13 of the book Practical Rails Projects, written by Eldon Alameda (Apress; ISBN: 1590597818).
Using Rails Analyzer for Performance Optimization (Page 1 of 2 )
Using Rails Analyzer
The Robot Co-op, the creators of the popular 43things.com, 43places.com, and 43people.com, has released an impressive set of tools for analyzing the performance of a Rails application. The tool set is called Rails Analyzer and can be found at http://rails-analyzer.rubyforge.org/.
Rails Analyzer consists of four independent parts:
The Production Log Analyzer can be used to analyze Rails log files. It produces a report that tells which actions are the most popular and which take the most time to render. It is an invaluable tool for measuring the performance of those actions that are used most often in the production setting.
The Action Profiler is used to profile individual actions. Run it as the next step after using the Production Log Analyzer to find the slow actions. With the Action Profiler, you can drill down to the action and see where it is taking its time.
Rails Analyzer Tools is a collection of tools for monitoring and benchmarking a Rails application. The tools included arebenchfor benchmarking a particular page,crawlerfor crawling a page and requesting all the local linked files on that page, andrails_statfor pinging the load status of a live production Rails application.
SQL Dependency Grapher can be used to visualize the frequency of table dependencies in a Rails application. (We won’t cover this part of the tool set in this chapter.)
Let’s see how Rails Analyzer can help us. First, log on to the production server and install the needed gems: