WooCommerce dashboard is slow when dealing with variable products
-
————————————————————————–
Summary: WooCommerce dashboard is slow when dealing with variable products
————————————————————————–
I’m developing a WooCommerce site and I noticed the admin area was slow when dealing with variable products.
I found the following demo WordPress site online that’s super fast: https://demo.woocommerce-b2b.com/ (try it yourself with login: demo/demo)
So I tried to figure out if the problem was related to my dedicated server with HDD disks, so I tried a new dedicated server (with SSD drive) and later also on WAMP on my Windows 10 personal computer.
At the moment I’m pretty sure this problem is not hardware-related.
>>>There must be some optimization to the server that we can do to make the backend as fast as in demo.woocommerce-b2b.com !!!<<<<<
I tried to play with the PHP max input variables | PHP time limit | PHP memory limit | Max input time | PHP post max size |WP_MEMORY_LIMIT | WP_MAX_MEMORY_LIMIT, etc, but it didn’t improve—–
Test
—–
0. Install a fresh installation of WordPress with a simple built-in template (Storefront 4.1.0 or Astra 3.7.9, or even Twenty Two, for example)
1. Install Woocommerce 6.4.0 with no extra addons and bloat
2. Woocommerce > Products
2.1 Add new
2.2. Title: Variable product 1
2.3. Product data: Variable product
2.4. Attributes > Custom product attribute > Color > Add
2.5. Values: Blue
2.6. Check “Used for variations”
2.7. Save attributes
2.8. Attributes > Custom product attribute > Add
2.9. Name: Size
2.10. Values: 34 | 34.5 | 35 | 35.5 | 36 | 36.5 | 37 | 37.5 | 38 | 38.5 | 39 | 39.5 | 40 | 40.5 | 41 | 41.5
2.11. Check “Used for variations”
2.12. Save attributes
2.13. Attributes > Custom product attribute > Add
2.14. Name: Heel
2.15. Values: 50 | 70
2.16. Check “Used for variations”
2.17. Save attributes
2.18. Variations > Create variations from all attributes > Go > OK
2.19 A message will that the 32 variations were added
2.20 Publish the product
3. Products > Mouse-hover “Variable product 1” > Ctrl+click 30x on “Duplicate”
4. Wait 1min and close the 30 opened tabs
5. Top-right > Type “copy” > Search products
6. Select all 30 copies > Bulk actions > Move to trash > Apply
7. Go to the Trash and click on “Empty trash”
8. Results (Time it takes to empty the trash):–> Server1: 20mins (It gives an error, but if I close the browser tab it will continue deleting in the background)
Dedicated server 6months old server on a datacenter (with 40+ sites hosted on it)
AMD Ryzen? 5 3600 6-core | CpuBenchmark 17826pts | 64 GB | 2x 2TB HDD
CentOS 7.9+cPanel | Apache 2.4.53| MySQL 5.7.37 | PHP 7.4.26–> Server2: 1min32s
Dedicated new server on a datacenter (just this site on it) | CentOS 7.9+cPanel
AMD Ryzen? 5 3600 6-core | CpuBenchmark 17826pts | 64 GB | 2x 512 GB NVMe SSD
CentOS 7.9+cPanel Apache 2.4.53| MySQL 5.7.37 | PHP 7.4.28
with MySql 5.7.37 it takes 1m32s
with MySql 8.0.28 it takes 2m15s–> Server2: 30s
My personal computer using WampServer for Windows 10
AMD Ryzen 5 1500X 4-core | CpuBenchmark 9082pts | 16 GB | 1TB GB NVMe SSD
Apache 2.4.51| MySQL 5.7.3 | PHP 7.4.26–> Server4: 3s (super fast! wow!)
https://demo.woocommerce-b2b.com/
Nginx | MySQLNote1: When I empty the trash using an SQL query in PHPmyAdmin in any server it takes less than 0.03seconds!
DELETE FROM sIWwqDP_postmeta WHERE post_id IN ( SELECT ID FROM sIWwqDP_posts WHERE post_type = ‘product’ AND post_status = ‘trash’ );
DELETE FROM sIWwqDP_posts WHERE post_type = ‘product’ AND post_status = ‘trash’;Note2: Deleting 30 SIMPLE products with no variations only takes 6 seconds on server 2.
Note3: Variable products basically transform a product into several products. In my example, each product has 32 variations. So when you delete 30 copies of it from the trash, it’s in fact deleting 33*30=990 products from the trash. Anyway, it’s kind of ridiculous, because PHPmyadmin can do it in a fraction of a second on any server.
- The topic ‘WooCommerce dashboard is slow when dealing with variable products’ is closed to new replies.