开发者

400+ms overhead anytime rails accesses current_user

开发者 https://www.devze.com 2023-04-06 01:54 出处:网络
my apps views are taking anywhere from 800-2000m开发者_StackOverflow社区s to load according to the logs.

my apps views are taking anywhere from 800-2000m开发者_StackOverflow社区s to load according to the logs.

I noticed for a page w/o accessing current_user the time is under 10ms... Anytime current_user is accessed it takes 400ms just to get current_user.

Any ideas why it is taking so long to get the current_user? Any way to track down where the lag is in performance?

Thanks


The logs should show you the database times as well as the render times. See if they track. i.e. high render times always implies a high database time.

There are various ways to profile rails if it is not a database issue.

The Railscasts #98 Request Profiling episode is old but it is a sample of what Rails has already built in for such questions.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号