Rails performance tools

7 views
Skip to first unread message

Harish

unread,
Dec 21, 2009, 7:52:35 AM12/21/09
to BANGALORE RUG-Ruby Users Group
Hi guys,

This is harish, I have been facing performance issues with one of my
rails application and have been trying to measure its performance..
Could anybody please suggest me which is the best performance
measuring tool for rails applications. Any tips for improving the
performance will be grateful too.


Thanks and Regards
Harish

Amit Mathur

unread,
Dec 21, 2009, 8:01:29 AM12/21/09
to bangal...@googlegroups.com
To start with here's couple of tools you can use to measure performance:

Rack::Bug  (http://github.com/brynary/rack-bug)
r-l-a (http://github.com/wvanbergen/request-log-analyzer)

Also, there was a thread on this list sometime back with lot of pointers on this topic. Try looking through the archives.

Good luck.

Regards,
Amit.


--

You received this message because you are subscribed to the Google Groups "BANGALORE RUG-Ruby Users Group" group.
To post to this group, send an email to bangal...@googlegroups.com.
To unsubscribe from this group, send email to bangalorerug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bangalorerug?hl=en-GB.



Siddharth Ravichandran

unread,
Dec 21, 2009, 8:08:30 AM12/21/09
to bangal...@googlegroups.com
I think New relic lite is really neat you could try that too. But Rack Bug is probably the best.

Rishav Rastogi

unread,
Dec 21, 2009, 9:00:35 AM12/21/09
to bangal...@googlegroups.com
Hey Harish,

Besides using the above tools.

Move to Ruby Enterprise Edition ( Its great!!! ). 

Also people seem to assume, slow page loads as a Rails performance issue(which may not be case). As a statistic "almost 80% of the time for a page to load is taken at the client side ie. your browser ( this includes DNS lookup, rendering CSS, interpreting Javascript etc.) 

Use Yslow ( its an Firebug extension, gives you a lot of insight on how to improve website performance ).

Also a few simple steps which go a long way in improving website performance:
  • Add Expires Headers to your images, static files like Javascript and CSS
  • Use ETags 
  • Use gzip encoding for images, static files like Javascript and CSS
  • Minify CSS, JS
Yslow will tell you all of the above steps and much more ( This is not rails specific, can be used for any website ) 

Hope this helps

Cheers,
Rishav

Rishav Rastogi

Cell : +91 9980616888
Yahoo : rishav_work
Gtalk : rishav.rastogi
Skype : rishavrastogi

Prateek Dayal

unread,
Dec 21, 2009, 9:10:02 AM12/21/09
to bangal...@googlegroups.com
I would second what Rishav is saying. We recently redesigned
www.muziboo.com and a simple change of loading all javascript at the
end of the page made a big difference in the perceived page load
speed. The js file size was the same but just loading it in the end
made a whole lot of difference.

You should also combine all css files into one and all js files into
one. Rails can do it for you if you just add :cache=>'cache/all' to
the directive that includes css/js files. You can google more for it.

You should use yslow and curl (with -I option) is also your friend if
you want to check if correct headers are being returned.

Regards
Prateek

--
Prateek Dayal
Co-Founder Muziboo.com

Personal Blog: http://www.prateekdayal.net/blog
Muziboo Dev Blog: http://devblog.muziboo.com

Harish P

unread,
Dec 21, 2009, 9:17:28 AM12/21/09
to bangal...@googlegroups.com
Thanks for everyone. I will try your suggestions and will come back with a feedback..

Thanks once again...




On Mon, Dec 21, 2009 at 7:30 PM, Rishav Rastogi <rishav....@gmail.com> wrote:



--
Regards, Harish
Blogs: http://harish-in.blogspot.com
http://harishwords.wordpress.com

Murali Vivekanandan

unread,
Dec 21, 2009, 10:35:50 AM12/21/09
to bangal...@googlegroups.com
Google Pagespeed is also a nice addition to Firebug. I like the fact it gives concrete action items with samples(like compression images).

On Mon, Dec 21, 2009 at 7:30 PM, Rishav Rastogi <rishav....@gmail.com> wrote:



--
Murali Vivekanandan
408 625 7580

Abhishek Parolkar

unread,
Dec 21, 2009, 11:05:24 AM12/21/09
to bangal...@googlegroups.com
All of those are great suggestions, can help you monitor/debug issues related to HTTP Req-Resp cycle. 

New-relic is so pretty good at telling you about latency in your code and runtime env.

If you want to go deeper into stuff , You can use good old GDB... http://weblog.jamisbuck.org/2006/9/22/inspecting-a-live-ruby-process , It would be useful if you have knowledge of how to work with GDB. look up wikipedia for more.

Valgrind/Callgrind has cool call_trace..... (Nothing ruby about it though)

Then, you also have Unroller , http://github.com/parolkar/unroller , It helps you only look up statement execution, but it does it pretty well.

It will be great if you share results of performance measurements & process of doing it with all of us to learn from.
 

Regards,
Abhishek Parolkar

aditya nalla

unread,
Dec 21, 2009, 10:45:44 PM12/21/09
to bangal...@googlegroups.com
Great suggestions everyone. Harish, I would suggest to start with as simple as looking into the log. The Rails log will give you a good idea on what queries are being made, which template is taking time to get loaded etc...

Look what is causing problem, is it database queries or is it the heavy js/css files or is it some piece of ruby code. If your are using Mysql use query profiler to check if the queries are written properly. For the rest of the issues you have already lot of suggestions from the others so I wont repeat . Probably you can send the log for the page across to the group and someone can suggest what's wrong.. ;)

Thanks,
Aditya

sharath ruby

unread,
Dec 22, 2009, 12:27:17 AM12/22/09
to bangal...@googlegroups.com

I notice that this great holistic helping co-operative approach is what is going to make ‘bangalorerug’ the best user groups. Keep it up guys. Let us make Ruby as ‘the Best’.  I can feel after a long a time in technology, a language is getting the recognition which is long over due.

Have a good day

Sharath

 


Reply all
Reply to author
Forward
0 new messages