Fulfill a large activerecord request with a large number of peripheral objects.
Adding ".includes" (preloading) greatly speeds it up, crushing all N + 1's.
Then the page is quickly displayed and spits it out into the logs:
Completed 200 OK in 504ms (Views: 104.2ms | ActiveRecord: 86.0ms)
However, then it will be * 90 SECONDS * until the page is sent to the browser (or curl, we tested with both). A.
During this time, the ruby process has a processor tied to 100%.
If we remove the ".includes" (preload), it returns to normal flabby performance without an hour and a half gulf of insignificance between the browser rendering and delivery pages.
WTF causes preload after effect !?
One colleague suggested the problem of garbage collection; How can I test this theory?
Rails 3.2.12
Ruby 1.9.3 (p286 and p327 checked)
source
share