• Resolved élisson Costa

    (@nossileee)


    UPLOAD ID: vbEjLTu2

    Hello, a few months ago I started experiencing slowness when editing registrations and products and orders.

    It was chaos, I did everything and NOTHING solved it, that’s when I found your plugin and by a stroke of “magic” everything started working again quickly, wonderful!

    HOWEVER, I left Woo running on version 8.7.0 for a long time, and yesterday, I decided to update to version 8.8.3 and due to my SADNESS, now, I CANNOT EVEN open an order.

    I tried to optimize the DB, returned the keys through your plugin to the default keys, applied the improvements again and NOTHING changed.

    I even opened support in Woo and thought 2 things:
    1- Or Woo did something about it that your plugin no longer works in this version.
    2- Or perhaps you would need some update to your plugin to make it functional and compatible with Woo 8.8.3.

    Do you think it would be possible to help me?

    Now I’m probably going to roll back the Woo version to 8.7.0 to see if this can be resolved.

    My client will go crazy if he tests and is unable to open the orders, I tried, and the server gets an error, sad =/

    If you can help, I would be very grateful.

    Because your plugin is incredible and saved me.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 18 total)
  • Thread Starter élisson Costa

    (@nossileee)

    Observation:

    I installed WP Rollback, returned the version to Woo 8.7.0 and by magic, the requests started working again quickly, before in fact, I couldn’t even edit the requests.

    So what I said is confirmed, when updating Woo, I will have problems opening requests, for now, I went back to the version that was working fine.

    Plugin Author OllieJones

    (@olliejones)

    Thanks for the upload and trying things.

    A quick observation. According to your upload, your database takes about 5GiB of tablespace (data and indexes) and your server has allocated 128M of buffer pool RAM. That’s not enough in most cases. Try to get your hosting provider to provision more RAM to your MariaDb database server.

    I have a new plugin in development that deals with absurdly inefficient order *search* in WooCommerce. Here. https://www.plumislandmedia.net/wordpress-plugins/fast-woo-order-lookup/

    But it doesn’t do anything for order “opening”. When you say “opening” do you mean viewing a single order from the WooCommerce-> Orders page?

    I don’t know of any incompatibilities between this Index WP MySql plugin and the recent version of WooCommerce. Thanks for letting me know it is possible.

    Thread Starter élisson Costa

    (@nossileee)

    Hello OllieJones!

    Firstly, thank you very much for your response and help.

    Regarding your first question, I spoke to my hosting support, and he sent me the following screenshot of my server:
    https://imgur.com/xGOcERp

    Which information should I adjust?
    Remembering that my current server has 16VCPU dedicated and 64GB of Ram.

    If you could instruct me on better adjustments and practices for the database, as I really don’t know what to do or improve.

    The only place I know how to adjust to improve is in the PHP INI Editor.

    -> When I say “open purchase orders” I mean it:

    Accessing the page: Woocommerce -> orders -> choose one of them and “open” it doesn’t work, it doesn’t open, I can’t see the content of the order (name, products, etc.) nothing opens.

    But with Woo 8.7.0 it works normally….not with 8.8.3, that’s why I Downgraded, but I had some headaches yesterday, and I believe it was due to the Downgrade.

    Plugin Author OllieJones

    (@olliejones)

    That’s a very large dedicated server. If it is all dedicated to the one web site you showed me, you can make your buffer pool much larger. I suggest 16GiB based on my assumption that the site is the only one.

    Here’s the documentation. https://mariadb.com/kb/en/innodb-buffer-pool/

    You can do that by putting this line in that conf file your hosting service showed me and restarting MariaDb.

    innodb_buffer_pool_size=17179869184

    This should improve overall performance of your site.

    As for the problem opening orders in the latest version of Woo, there is almost certainly something incompatible between one of your WooCommerce add-on plugins and that version. If it fell to me to troubleshoot this problem, I would set up a staging site, then install and activate the Query Monitor login by John Blackbourn. Then look at query monitor output when trying to view an order. Maybe you’ll see an error message that identifies the offending plugin.

    If that doesn’t work: Next I would enable WP_DEBUG and WP_DEBUG_LOG and look for errors.

    I hope this helps.

    Thread Starter élisson Costa

    (@nossileee)

    Hello!

    I made the adjustment with the support of my server, it’s my VPS server, but I have support that helps me, the people at SPanel, it’s a great service and 24/7.

    They adjusted it to 8GB because I have about 15 domains on the server.

    But the vast majority have little traffic and sell little.

    It really is one (the one I sent you) that sells a lot and has the most traffic.

    Hopefully it improves a lot, he checked the server and said that there really was only 128MB in the buffer.

    Now it looks good =)

    But for me to really test it, I would have to upload the Woo version again, I’ll wait for that and take it easy at another time.

    Anyway, I’m so grateful for your help, you’re amazing.

    See you later =)

    Thread Starter élisson Costa

    (@nossileee)

    Note: in the other domains everything is already updated and I have no problems….so I don’t believe there would be any incompatibility.

    This website alone, as it has had so many requests since 03/2020, must be due to the volume/size that ends up causing these slowdowns.

    I hope this BD adjustment helps.

    I have facing the same problem after updating woo 8.8.3. When I tried to open order edit page, it loads about 50-60 sec and query monitor shows one slow query on wc_order_meta table lasting about 50sec. I have tested plugin and theme conflict test. It is database query problem and it occurs on sites with large order meta database.

    • This reply was modified 6 months, 2 weeks ago by alinnz.
    Plugin Author OllieJones

    (@olliejones)

    Plugin Author OllieJones

    (@olliejones)

    The offending query seems to be

     SELECT DISTINCT meta_key
       FROM wp_wc_orders_meta
      WHERE meta_key NOT LIKE '\_%'
      ORDER BY meta_key ASC LIMIT 30

    The standard WooCommerce table definition has one of those accursed (191) prefix keys on the meta_key table. So, on MariaDB 10.11 I get a full table scan. But if I change that key to a non-prefix key like this

    ALTER TABLE wp_wc_orders_meta
        DROP KEY meta_key_value,
         ADD KEY meta_key_value (meta_key, meta_value(100)),
      ENGINE=INNODB;

    I get an index scan. That may be faster on a system with many orders. It isn’t on my test system with 3000 orders, it’s slower.

    I can get it to be much faster, with that changed key, by changing the query to

    SELECT DISTINCT meta_key
       FROM wp_wc_orders_meta
      WHERE meta_key >= '0'
      ORDER BY meta_key ASC LIMIT 30

    which gets the same result using a loose index range scan.

    Please let me know whether the key I mentioned makes your problem better.

    And, it looks like I have another feature to add to this plugin: https://www.plumislandmedia.net/wordpress-plugins/fast-woo-order-lookup/

    • This reply was modified 6 months, 2 weeks ago by OllieJones. Reason: more info after finding the source of the offending query
    Phil

    (@probablynotphil)

    Maybe the same issue as https://github.com/woocommerce/woocommerce/issues/47212? Reported as fixed in WooCommerce 8.9

    Thank for your help, Sir @olliejones !

    It is varchar (255) and I tried to change 191 but it didn’t show any difference. I will try your suggestion.

    This query run when I open an order to edit. Caller is here.

    Automattic\WooCommerce\Internal\DataStores\CustomMetaDataStore->get_meta_keys
    Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes\CustomMetaBox->order_meta_keys_autofill
    Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes\CustomMetaBox->render_meta_form
    Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes\CustomMetaBox->render_custom_meta_form
    Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes\CustomMetaBox->output
    Automattic\WooCommerce\Internal\Admin\Orders\Edit->render_custom_meta_box
    do_meta_boxes
    Automattic\WooCommerce\Internal\Admin\Orders\Edit->render_meta_boxes
    Automattic\WooCommerce\Internal\Admin\Orders\Edit->display
    Automattic\WooCommerce\Internal\Admin\Orders\PageController->output
    do_action('woocommerce_page_wc-orders')

    Thanks for your information @probablynotphil

    Glad to know it will be fixed in upcoming update ??

    And very much thanks for your help Sir @olliejones !

    Plugin Author OllieJones

    (@olliejones)

    OK, I updated my newer, not-yet-in-the-repo, order handling plugin to deal with this slow query.

    How to get the plugin. https://www.plumislandmedia.net/wordpress-plugins/fast-woo-order-lookup/

    Github issue: https://github.com/OllieJones/fast-woo-order-lookup/issues/8

    Source repo: https://github.com/OllieJones/fast-woo-order-lookup

    I would be grateful if you would try this out.

    THANKS, both for bringing it to my attention and, if you can, trying out the plugin.

    • This reply was modified 6 months, 2 weeks ago by OllieJones.
    Phil

    (@probablynotphil)

    Once again, thank you @olliejones for your outstanding work on this. You’re a DB wizard!

    Thank you for your help and great support Sir @olliejones

Viewing 15 replies - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.