News for hackers. Stuff that matters.
Re:Patching Rails Performance by matthewcford on Thursday August 06, 2015 @09:26PM (#10020474)
A lot of time according to new relic is spent in Middleware/Rack/ActionDispatch::Routing::RouteSet#call on one of our Rails apps on Heroku. Any ideas on what might be the cause? (I'm within memory limits standard-2x)
Re:Patching Rails Performance by schneems on Thursday August 06, 2015 @10:24PM (#10020659)
Whooops responded with old account. If you run `$ env RAILS_ENV=production rake middleware` you'll see that your final app that gets mounted is actually the "routes" of your app.

    run CodeTriage::Application.routes

Essentially that RouteSet#call wraps every piece of code you've ever written for your app. I think that newrelic is reporting that is the entry point to your app code which makes sense that it takes the longest amount of time.

For a better view of request break down I would recommend checking out https://github.com/MiniProfiler/rack-mini-profiler. You'll not only see where request time is being spent, you'll see how it "stacks up". The flame graphs are pretty useful check out http://www.nateberkopec.com/2015/08/05/rack-mini-profiler-th... for more info.