Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to profile Rails with ruby-prof and JMeter

I'd like to profile a Rails app using ruby-prof and JMeter. I'm not interested in suggested methods of profiling particular controller/action/ or model method, I'd like to profile full stack, top to bottom.

So I run something like this:

RAILS_ENV=production ruby-prof -f prof.out script/server > /dev/null

Then I run my JMeter test plan on it. The problem however is that interrupting it with CTRL+C or SIGKILL kills ruby-prof too before it can write any output. How do I stop mongrel server without interrupting ruby-prof?

like image 976
skrat Avatar asked Apr 21 '11 12:04

skrat


1 Answers

An alternative to running ruby-prof would be to deploy your application to a staging environment (or any sort of environment that replicates your production environment fairly closely), with newrelic performance monitoring, and then run a heavy load test on it from JMeter. I find that this more accurately replicates real-world performance, and you can always add newrelic custom metrics to your app if you need more fine-grained performance data than newrelic provides by default.

like image 117
Mike Gillis Avatar answered Oct 18 '22 05:10

Mike Gillis