ActionDispatch::Routing::RouteSet 间歇性地花费太长时间来路由请求 [英] ActionDispatch::Routing::RouteSet intermittently takes too long to route requests

查看:43
本文介绍了ActionDispatch::Routing::RouteSet 间歇性地花费太长时间来路由请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个遗留的 rails 应用程序,其中间歇性的一些请求需要很长时间才能路由到正确的操作.我们使用 rails 3.0.10

I am working on a legacy rails app where intermittently some request take too long to be routed to the correct action.We using rails 3.0.10

机架计时器(应用程序操作)--ActionDispatch::Routing::RouteSet:20506.478548049927 毫秒

有什么地方可以让我开始调试以了解更多信息吗?

Is there any place I can start debugging to figure out more?

推荐答案

我一直在想这个问题有一段时间了.我一直在跟踪 Graphite 上的中间件时间,可以看到总应用程序运行时间与 ActionDispatch::RailsRouting::Routset 的运行时间之间存在明显的相似性.图表几乎重叠.

I had been wondering about it for some time now. I have been tracing middleware times on Graphite and could see a stark similarity between the total application runtime and the runtime for ActionDispatch::RailsRouting::Routset. The graphs have almost been overlapping.

在 Luke Ludwig(编写 Rack Timer 的人)发表的一篇帖子中找到了可能的解释.

Found a possible explanation in one of the posts made by Luke Ludwig (the guy who wrote Rack Timer).

它还会打印出实际应用程序操作所用的时间,它与 Rails 路由相结合,这是最后一个中间件.

It will also print out the time elapsed by the actual application's action, which is combined with Rails routing, the final piece of middleware.

来源:http://pulse.sportngin.com/news_article/show/137153?referrer_id=543230

事实证明,Rails 路由包括应用程序花费的总时间,因此运行时间很长.

Turns out that Rails routing includes the total time spent by the application, hence a high runtime.

希望这会有所帮助!

这篇关于ActionDispatch::Routing::RouteSet 间歇性地花费太长时间来路由请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆