Por que o ActionDispatch :: Routing :: RouteSet leva tanto tempo
Estou usando o Grape no topo do Rails 4.2.1 para fornecer API para o nosso aplicativo.
Mas quando eu verifico o desempenho da Newrelic hoje, descobri queRackApp Proc#call
eGrape API::Root#call
estão ocupando muito tempo. (Veja a captura de tela)
Depois tentei registrar o tempo consumido no middleware comrack_timer
e descobriu queActionDispatch::Routing::RouteSet
está ocupando a maior parte do tempo:
Rack Timer (Application Action) -- ActionDispatch::Routing::RouteSet: 67.12579727172852 ms
Rack Timer (Application Action) -- ActionDispatch::Routing::RouteSet: 101.51457786560059 ms
Rack Timer (Application Action) -- ActionDispatch::Routing::RouteSet: 84.18059349060059 ms
Rack Timer (Application Action) -- ActionDispatch::Routing::RouteSet: 1236.2565994262695 ms
Rack Timer (Application Action) -- ActionDispatch::Routing::RouteSet: 8.124351501464844 ms
Rack Timer (Application Action) -- ActionDispatch::Routing::RouteSet: 55.65309524536133 ms
Existem até casos que levam de 500 ms a 1000 msActionDispatch::Routing::RouteSet
. Como rastrear esse problema e como saber o que fiz de errado nas rotas do Rails?
Muito obrigado pela ajuda.