简体   繁体   English

ActionDispatch :: Routing :: RouteSet#调用Rails 4.1真的很慢

[英]ActionDispatch::Routing::RouteSet#call Rails 4.1 really slow

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. 在Heroku上托管的我的Rails 4.1应用程序中,当负载增加时,一些PUT请求变得非常慢。 The slowest one today was 53 seconds. 今天最慢的是53秒。 All without the database (MongoDB) registering any slow queries. 所有没有数据库(MongoDB)注册任何慢查询。 Normally this request takes 0.3ms so pretty fast. 通常这个请求需要0.3ms这么快。 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. 在安装New Relic后,它更清楚了解情况,但我仍然不知道在哪里解决这个问题。

The code in the controller is fast, but according to New Relic, the thing that is slow is ActionDispatch::Routing::RouteSet#call 控制器中的代码很快,但根据New Relic,速度慢的是ActionDispatch :: Routing :: RouteSet #call

Here's a dump of what New Relic reports: 这是New Relic报道的转储:

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. 当我们升级到Performance Dynos时,我们已经停止看到这些错误。 But this is something that seems to be seriously badly configured at Heroku. 但这似乎是Heroku严重错误配置的东西。

The slowdown is an indicator that it's Heroku-specific. 减速表明它是Heroku特有的。 Probably why you saw the problem disappear when you upgraded to Performance Dynos. 您升级到Performance Dynos时可能会看到问题消失的原因。

您可以使用rack-mini-profiler来检查真正的问题所在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails应用程序中的慢动作:ActionDispatch :: Routing :: RouteSet #call - Slow action in Rails application: ActionDispatch::Routing::RouteSet#call Rails吞吐量峰值报告为中间件/ Rack / ActionDispatch :: Routing :: RouteSet#call - Rails throughput spike reported as middleware/Rack/ActionDispatch::Routing::RouteSet#call Rails 5 - 如何修复 Middleware/Rack/ActionDispatch::Routing::RouteSet#call 问题? - Rails 5 - How to fix Middleware/Rack/ActionDispatch::Routing::RouteSet#call issue? Rails 3.2.8:ActionDispatch :: Routing :: RouteSet :: Mapper,它存在吗? - Rails 3.2.8: ActionDispatch::Routing::RouteSet::Mapper, Does it exist? 为什么ActionDispatch :: Routing :: RouteSet需要这么长时间 - Why ActionDispatch::Routing::RouteSet takes so long 你如何使用ActionDispatch :: Routing :: RouteSet recogn_path? - How do you use ActionDispatch::Routing::RouteSet recognize_path? 在Rails3插件中替换ActionController :: Routing :: RouteSet :: Mapper.send - replacing ActionController::Routing::RouteSet::Mapper.send in Rails3 plugin 我在使用Rails 4.1路由时遇到问题 - I'm having problems with rails 4.1 routing 控制器测试路由错误与minitest-rails和rails 4.1 - Controller test routing error with minitest-rails and rails 4.1 VirtualBox上的Rails服务器运行速度非常慢 - Rails server on VirtualBox is running really slow
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM