400 + ms service messages anytime rails accesses current_user

my application views take from 800 to 2000 ms to download according to the logs.

I noticed that for a page without access to current_user, the time is less than 10 ms ... Any time that current_user accesses it, it takes 400 ms to get current_user.

Any ideas why it took so long to get current_user? Any way to track when performance lags?

thanks

+4
source share
1 answer

Logs should show database time as well as render time. See if they are tracking. that is, high imaging time always implies a high database time.

There are various ways to profile rails if this is not a database problem.

Railscasts # 98 Request Profiling is old, but it is an example of what Rails has already built for such issues.

0
source

All Articles