-->

Slow action in Rails application: ActionDispatch::

2020-06-05 03:39发布

问题:

According to NewRelic the slowest transaction in my application is:

Middleware/Rack/ActionDispatch::Routing::RouteSet#call

It takes about 261 ms app server time.

What is this RouteSet#call? Rails routing mechanism? Is 261 ms a normal value? How to speed it up?

回答1:

If by any chance you are using the "Treat" gem, remove it. Seems like a bug.

https://github.com/louismullie/treat/issues/84



回答2:

In my case, I was using rocket_pants. Its controllers don't inherit from ActionController::Base so it was showing up in newrelic as middleware. https://discuss.newrelic.com/t/middleware-call-shown-as-web-transaction/25861/8