ActionDispatch :: Routing :: RouteSet#call Rails 4.1真的很慢 [英] ActionDispatch::Routing::RouteSet#call Rails 4.1 really slow
问题描述
在Heroku托管的Rails 4.1应用程序中,当负载上升时,一些PUT请求会变得非常慢。今天最慢的是53秒。没有数据库(MongoDB)注册任何慢速查询。通常这个请求需要0.3ms,非常快。无论什么有效载荷,请求都很慢。
在安装New Relic后,它将更多地了解这种情况,但我仍然不知道该在哪里解决这个问题问题。
控制器中的代码很快,但根据New Relic,速度慢的是ActionDispatch :: Routing :: RouteSet#call
下面是New Relic报告的一个转储:
最慢的组件计数持续时间%
ActionDispatch :: Routing :: RouteSet#call 1 53,000 ms 100%
Plugin :: FetchablesController#update 1 38 ms 0%$ b $ 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%
总计53,000 ms 100%
其他一些nfo可能有助于或可能与此有关。
namespace:plugin do $ b $我有一个路由的别名,但我不明白为什么这很重要。 b资源:收藏品,路径::minables
结束
关于可能发生什么的任何想法我可以做些什么来解决这个问题将不胜感激。
更新
所以这似乎与内存有关。当我们升级到Performance Dynos时,我们不再看到这些错误。但这是Heroku似乎严重配置不当的问题。
减速是Heroku特有的一个指标。可能为什么当你升级到Performance Dynos时你看到问题消失。
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.
这篇关于ActionDispatch :: Routing :: RouteSet#call Rails 4.1真的很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!