【发布时间】:2018-01-23 12:24:06
【问题描述】:
在 rails 5 中,我使用 NewRelic 来监控应用程序。在 newrelic 中,我立即得到Middleware/Rack/ActionDispatch::Routing::RouteSet#call 作为最耗时的。我不知道为什么会出现这个问题。
在 routes.rb 中,
devise_for :admins
mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
scope :api do
scope :v1 do
devise_for :users, controllers: {
registrations: 'users/registrations',
confirmations: 'users/confirmations',
sessions: 'users/sessions',
passwords: 'users/passwords'
}
get 'confirm_user_email', to: 'user_emails#confirm_email', as: :confirm_user_email
get 'forgot_password', to: 'landing_page#forgot_password'
post 'send_invitation', to: 'users#send_invitation', as: :send_invitation
end
end
unless Rails.env.production?
mount LetterOpenerWeb::Engine, at: '/letter_opener'
end
require 'sidekiq/web'
mount Sidekiq::Web => '/sidekiq'
get "*path" => "home#index"
mount ActionCable.server => '/cable'
请帮我解决这个问题。
【问题讨论】:
-
好吧,你检查过你的路由器了吗?
-
是的。问题也更新了。
-
@ShruthiR 你找到解决方案了吗?我也面临同样的问题。请帮我弄清楚。
-
抱歉,我也没有得到解决方案。
-
我感觉它与 ActionCable 有关。我也有同样的情况,我正在将 ActionCable 用于实时更新页面。
标签: ruby-on-rails ruby performance routing newrelic