Support » Plugin: WooCommerce » Products with many variations cause huge CPU spike, slow loading

  • Resolved theoceanagency

    (@theoceanagency)


    Hello,

    Products with lots of variations (200+) load very slowly and cause massive CPU spikes. The site in question is hosted on a VPS server with GoDaddy, and even still visiting one of these products just once can spike the CPU to almost 100%. These pages can load very slowly, with a TTFB of as much as 45 seconds in some cases. We’ve been in contact with their support over this issue with no luck.

    I have already tried disabling all plugins (which are all fully updated), and testing on the Twenty Seventeen theme, and I cannot find an obvious culprit, other than that this issue only occurs on products with large amounts of variations.

    Is it possible that this is the host’s fault? The site does not act this way on our separate staging environment where it was built and tested, which is hosted on SiteGround.

    What further steps can be taken to troubleshoot this? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Joel Williams

    (@joelwills)

    Automattic Happiness Engineer

    Hi there!

    Sorry to hear about this issue! This shouldn’t be a problem in WooCommerce as the max ajax variation threshold is set to 30 by default.

    This means that if there are more than 30 variations it won’t calculate the available options and just show all combinations (then show a not available message if an unavailable combination is selected). This improves loading time and should prevent any issues with more than 30 combinations of variations.

    You can test if this is a problem by reducing it to 10, eg:

    https://gist.github.com/claudiosanches/6f91ad228c2176b986b2

    Is it possible that this is the host’s fault? The site does not act this way on our separate staging environment where it was built and tested, which is hosted on SiteGround.

    It it’s the same site and product on Sitrground that is working correctly, but not on GoDaddy, it does sounds as if there is something in the server configuration that is causing this.

    One thing you could check is this:

    https://docs.woocommerce.com/document/problems-with-large-amounts-of-data-not-saving-variations-rates-etc/

    Hope that helps! Please let us know if you have any further questions, thanks!

    Plugin Support yukikatayama

    (@yukikatayama)

    Automattic Happiness Engineer

    Hi @theoceanagency,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    Hi, I’m getting the same exact issue with Digital Ocean.

    “his shouldn’t be a problem in WooCommerce as the max ajax variation threshold is set to 30 by default.

    This means that if there are more than 30 variations it won’t calculate the available options and just show all combinations (then show a not available message if an unavailable combination is selected). This improves loading time and should prevent any issues with more than 30 combinations of variations.”

    Can you explaing this to me like I’m 5 because I’m not sure. If I have 100 product variations should i increase the threshold to 100 and the will fix the problem?

    Thanks

    Plugin Support Joel Williams

    (@joelwills)

    Automattic Happiness Engineer

    @soulipsyz

    > If I have 100 product variations should i increase the threshold to 100 and the will fix the problem?

    This depends on what your problem is. If your site is loading slowly, then no, this will make it even worse. Setting that to 100 will mean it will calculate up to 100 available combinations.

    This will cause the page to load slowly as it has to calculate over 100 variations and only show what is available.

    It’s set to 30 by default for speed, most products have less than 30 combinations of attributes and terms so it will show only those that are available.

    When there are more than 30 it shows all possible combinations of variations, regardless of whether that is available or not, as this loads much more quickly.

    Setting that to 100 will mean it will calculate up to 100 variations that are available, so if your product has 90 combinations of product attributes, it will calculate them all, which may take a long time.

    If it has 110 it will do the same as it is doing with 30 and just show all combinations, regardless of them actually being available.

    If you’re still having problems, please open your own thread for issues you may be having as this thread is resolved and not closely monitored. All the best!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Products with many variations cause huge CPU spike, slow loading’ is closed to new replies.