I know this is a recurring topic, but currently my application is
running very slow and I would like to figure out why. Every
transaction, except for the login page, have an average response time
in the 8,000~ 14,000ms range (DB: 300ms range), which is absurd. I
have implemented action caching and fragment caching on the views, but
those only help when there is a cache hit. On a miss, it still takes
8+ seconds to load.
I tried monitoring the application on new_relic and found out that my
view takes up for nearly 90% of the load time.
Furthermore, I have ran ruby-prof on one of the slower transactions
and found out that 65% of the transaction was from the method
'render_without_active_scaffold' which is part of the active_scaffold
plugin. I suspect the fact that the transaction calls
'render :partial' 45 times doesn't help much, but the application is
pretty complex, and those 45 partial renderings are quite necessary.
I've searched on google to see if anybody else had problems with
activescaffold, but that doesn't seem to be the case....
Some things I've tried
- Replace helper methods in the views with the html they produce.
- Caching (action, fragment)
- Eager loading (although DB query times are in the 300ms range)
Does anybody have any idea why 'render_without_active_scaffold' or any
other rails function (like render partial) would take so long?
Is it because my application is running on a VM?
Thanks in advance!