• On my Woocommerce webshop page (http://www.hobbyaruhaz.hu/webaruhaz) Woocommerce plugin generates 592 queries from 656 in total according to Query Monitor. Is it normal?

    The main callers of the queries:
    get_option() (124 queries)
    update_meta_cache() (124 queries)
    WP_Post::get_instance() (81 queries)
    get_term_by() (60 queries)
    WP_Query->get_posts() (15 queries)

    I have 10.000 products and 410 categories. I also checked the queries on the category back-end page. Woocommerce causes 1191 from 1235 (update_meta_cache() generates 797 of this number!)

    I am very very confused because my CPU and physical memory usage can be even 40-70% during a single page load. I have already tried to solve this issue (changing WordPress template, analized the plugins, optimazed images, using cache plugin) but didn’t help.

    PS: according to Query Monitor I have only 1 slow query: SELECT option_name, option_value
    FROM wp_options
    WHERE autoload = ‘yes’

    I am not a developer so my knowled is limited. What should I do? Thank you very much for your help guys.

    https://wordpress.org/plugins/woocommerce/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Your slow query is WordPress grabbing all options which autoload.

    Run this to speed up options table https://wordpress.org/plugins/artiss-transient-cleaner/

    For a page of 16 products, I get 95 queries.

    Thread Starter exlege

    (@exlege)

    Thank you for the idea. I have tried this plugin just now and I have 130503 transients, and the plugin deleted the 5 expired ones. I have a bit less queries but still have the slow query and high memory usage problem.

    Woocommerce plugin causes this but I don’t know what else I should do. :/
    I have like 100-150 visitors a day and the physical memory usage is 1000-1500 MB permanently! Do you have any more idea Mike? Thank you very much!

    Are you using WooCommerce just by itself, or are you using other extensions? I know that some of the extensions can add more overhead to pages that use WooCommerce.

    I just did a quick check on a site I’m developing. On a single product page, where the product has about 20 variations, I get 395 queries. Most of those come from WooCommerce and my theme (Genesis), though some a few are coming from addons like the Dynamic Pricing and Wishlists.

    Thread Starter exlege

    (@exlege)

    Hi ancawonka! Thank you very much for your answer! Yes, actually I am using 12 extensions for Woocommerce (I need them, that’s the problem). However according to Query Monitor the huge number of queries coming from Woocommerce itself not other plugins.

    Huh. Just because I’m curious, I went to look at another combination of WordPress + WooCommerce. The same page I looked at earlier (which was running WP 4.4 and WooCommerce 2.5.1, and had 395 queries) shows 456 Queries in WP 4.4.2 and WooCommerce 2.4.10.

    The same product page in WordPress 4.3.2 and WooCommerce 2.4.10 results in a whopping 753 Queries.

    Now, these are three different WordPress environments (WP Engine production, WP Engine staging and my local dev environment), but it’s interesting to see the improvement (?) in number of queries with increasing version numbers of WordPress and WooCommerce.

    I’m also seeing high query numbers, will do some testing on a clean install. Even on non WooCommerce pages (we have the mini cart in the header), we are loading about 54 woocommerce queries, not including the wishlists plugin.

    exlege we’re having some success caching certain bespoke functions with the Transients API:
    https://codex.wordpress.org/Transients_API

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Woocoomerce generates MANY queries! Is it normal?’ is closed to new replies.