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
rake middleware. – fivedigit Dec 18 '14 at 19:17