Drupal 7 / Commerce / Rules performance issue

Events happening in the community are now at Drupal community events on www.drupal.org.
vegantriathlete's picture

I've created a gist describing the specifics. The TL;DR is that the page loads about 4 - 5 times slower for authenticated than for anonymous. See the gist at:

https://gist.github.com/vegantriathlete/0fff6e3628bd5a3e583d

Comments

Check commerce_order table

b3nji's picture

What is the size of your commerce_order table? I am using a module that caused the commerce_order table to grow to 600,000+ rows. PHP processes were growing to 700MB and signifcantly slowing page loads until I removed expired shopping carts from the commerce_order table.

DIY Drupal 7 Performance

mikeytown2's picture

I have a presentation that goes through steps to take that should help in terms of speeding up your site
https://docs.google.com/presentation/d/1AgnurTWsWdMAFjfFmSU7mk2zfJu8jG_K...
Be sure to look at the speaker notes as that contains additional info on that slide.

Just taking a quick glance at the site and you could speed it up by enabling css/js aggregation on your admin/config/development/performance page (slide #36-37 in the linked presentation).

Gdocs gives a 404 for your

bhosmer's picture

Gdocs gives a 404 for your doc link Mike.

Great presentation by the way recently too!

Have you checked with Devel

Brian Altenhofel's picture

Have you checked with Devel or XHProf to see where your bottleneck really is? I've had sites that had several hundred rules run per page with minimal difference.

How are you running your custom rules? Are you loading entities and then looping over them to check conditions? I've seen that mistake before - there are much more efficient ways.

Do you have inefficient views that could be cached for authenticated users?

Thanks for all the great responses so far!

vegantriathlete's picture

I will follow up on all the suggestions. Keep them coming!

I have not run Devel of XHProf yet. Those are on my lists of things to consider. At the moment the client didn't want me to invest the time in doing the profiling. I know that Devel can be done relatively quickly. But, XHProf takes a bit more time to set up and use from what I understand.

Rules calls custom actions that I have written based on whether the condition passes that it's a given user id signed in.

I would look into your

richwandell's picture

I would look into your cacheing and add either redis or memcache into the mix. And like Brian Altenhofel said, look into your views and see if they can be cached. Your site appears to be serving from it's page cache when logged out (as it should) but when you are logged in the pages are not served from page cache.

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: