Why should calling Application # be slow?

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

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

It takes more than 5 seconds to even get to ActionDispatch::Routing::RouteSet#call , not to mention the controller method.

Why can it be so slow? And where could I try to delve into this?

None of my intermediaries look particularly strange:

 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
source share
1 answer

Do not rely too much on NewRelic performance. I recently got the same issue with an NR page rated around 3s for download. After closing several applications and restarting firefox, NR showed less than 300 ms

0
source

Source: https://habr.com/ru/post/979873/


All Articles