6

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?

skrat
  • 5,518
  • 3
  • 32
  • 48
  • Don't you want to use the [debugger](http://guides.rubyonrails.org/debugging_rails_applications.html)? That's how I do [stack sampling](http://stackoverflow.com/questions/375913/what-can-i-use-to-profile-c-code-in-linux/378024#378024). – Mike Dunlavey Apr 21 '11 at 13:05
  • 2
    JMeter is usually used for load testing. And ruby-prof is usually used for profiling and comes with a very very expensive cost. I see the use of these two tools at the same time as not really compatible. I'd rather run JMeter to find the actual limit of the system, then do a pass with ruby-prof to profile what's the slowest and start again to see the actual improvement... – Oct Sep 06 '11 at 12:58

2 Answers2

1

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.

0

Webrick stops upon a SIGINT and let prof dump its data correctly.

kill -INT

Oct
  • 1,505
  • 13
  • 18