5

For some reason my ::Application#call is incredibly slow. In one case it took 3,840ms according to New Relic's instrumentation.

The documentation just describes this method as: Implements call according to the Rack API. It simply dispatches the request to the underlying middleware stack.

It takes over 5 seconds to even get to ActionDispatch::Routing::RouteSet#call, let alone my controller's method.

Why might this be so slow? And where could I try to instrument to dig into this further?

None of my middlewares look to be particularly odd, either:

use Raven::Rack
use #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007fd836083e08>
use Rack::Runtime
use ActionDispatch::RequestId
use Rails::Rack::Logger
use Rack::Cors
use ActionDispatch::ShowExceptions
use ActionDispatch::DebugExceptions
use ActionDispatch::RemoteIp
use ActionDispatch::Callbacks
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
use ActionDispatch::ParamsParser
use Clearance::RackSession
use Rack::Head
use Rack::ConditionalGet
use Rack::ETag
use ActionDispatch::Flash
use Rack::SslEnforcer
run CookacademyApi::Application.routes
6
  • Did you check the middleware instrumentation on New Relic? If there's something slow between the call to the app and the call to the routes, it might be a middleware. To see what's in your middleware stack, you can run rake middleware. – fivedigit Dec 18 '14 at 19:17
  • @fivedigit The middelware instrumentation doesn't appear to show me much: cl.ly/image/1B3P143p2g3K – Josh Smith Dec 18 '14 at 19:25
  • @JoshSmith Did you find any solution? I am also facing the same issue – Hardik Joshi Feb 10 '15 at 10:10
  • @JoshSmith same issue here, anything? – bcackerman Mar 29 '15 at 18:27
  • yea newrelic is really not that useful :( – okysabeni May 1 '15 at 19:49
0

Don't rely too much on NewRelic metrics. I recently got the same issue with a page NR estimated around 3s to load. After closing a couple of applications and restarting firefox NR showed less than 300ms

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.