I've searched for days but can't find any relevant answers to this question.
In my Rails 4.1 app hosted on Heroku, when the load goes up, some PUT requests get REALLY slow. The slowest one today was 53 seconds. All without the database (MongoDB) registering any slow queries. Normally this request takes 0.3ms so pretty fast. The request is slow no matter what the payload is.
Upon installing New Relic it shed some more light on the situation, but I still don't know where to fix this problem.
The code in the controller is fast, but according to New Relic, the thing that is slow is ActionDispatch::Routing::RouteSet#call
Here's a dump of what New Relic reports:
Slowest components Count Duration %
ActionDispatch::Routing::RouteSet#call 1 53,000 ms 100%
Plugin::FetchablesController#update 1 38 ms 0%
Rails::Rack::Logger#call 1 1 ms 0%
ActionDispatch::Cookies#call 1 1 ms 0%
ActiveSupport::Cache::Strategy::LocalCache::Middleware#call 1 0 ms 0%
Rack::Runtime#call 1 0 ms 0%
Total 53,000 ms 100%
Some other info that might help or could perhaps have something to do with this. I have an alias for the routes, but I can't see why that should matter.
namespace :plugin do
resources :fetchables, path: :minables
end
Any ideas on what might be going on and what I could do to fix it would be greatly appreciated.
Update So it seems that this is memory related. When we upgraded to Performance Dynos we've stopped seeing these errors. But this is something that seems to be seriously badly configured at Heroku.
The slowdown is an indicator that it's Heroku-specific. Probably why you saw the problem disappear when you upgraded to Performance Dynos.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With