High CPU load with grouped product
-
I am experiencing high CPU load with a grouped product with 500 subproducts. The webshop is new and has only this one product.
The PHP-FPM process is stuck at 99% for around eight seconds before the first byte in the browser appears. I guess the process is sorting the entries in the grouped product list before they are displayed.
The delay is not due to MySQL. I checked that all queries are coming from the query cache, and they are served to the PHP process rapidly. The PHP process then starts crunching for several seconds.
Server environment:
Dedicated server, with this webshop as the only site.
MySQL on the same server, No other processes on the server
128GB RAM
Intel Xeon E5-1650V2 3.50 GHz
Current plugins: WPML, W3 Total Cache, Toolset Types, and two payment gateway plugins.The performance problem was already present in the setup without WPML.
What can I do to speed up the PHP processing besides dropping a lot of the subproducts from the grouped product?
The page I need help with: [log in to see the link]
-
This is the status report of the system.
### WordPress Environment ### WordPress address (URL): https://webshop.pic2pat.com Site address (URL): https://webshop.pic2pat.com WC Version: 4.8.0 REST API Version: ? 4.8.0 WC Blocks Version: ? 3.8.1 Action Scheduler Version: ? 3.1.6 WC Admin Version: ? 1.7.3 Log Directory Writable: ? WP Version: 5.6 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ? Language: en_US External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 7.2.24 PHP Post Max Size: 32 MB PHP Time Limit: 70 PHP Max Input Vars: 1000 cURL Version: 7.61.1 OpenSSL/1.1.1g SUHOSIN Installed: – MySQL Version: 5.5.5-10.1.48-MariaDB Max Upload Size: 18 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected. DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 4.8.0 WC Database Prefix: wp_ Total Database Size: 12.74MB Database Data Size: 6.62MB Database Index Size: 6.12MB wp_woocommerce_sessions: Data: 0.03MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 0.02MB + Index: 0.11MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_icl_content_status: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_icl_core_status: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_icl_flags: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_icl_languages: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_icl_languages_translations: Data: 0.20MB + Index: 0.17MB + Engine InnoDB wp_icl_locale_map: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_icl_message_status: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_icl_mo_files_domains: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_icl_node: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_icl_reminders: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_icl_strings: Data: 0.05MB + Index: 0.09MB + Engine InnoDB wp_icl_string_batches: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_icl_string_packages: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_icl_string_pages: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_icl_string_positions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_icl_string_status: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_icl_string_translations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_icl_string_urls: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_icl_translate: Data: 0.20MB + Index: 0.06MB + Engine InnoDB wp_icl_translate_job: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_icl_translations: Data: 0.13MB + Index: 0.38MB + Engine InnoDB wp_icl_translation_batches: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_icl_translation_downloads: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_icl_translation_status: Data: 0.23MB + Index: 0.02MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mollie_pending_payment: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_options: Data: 1.34MB + Index: 0.08MB + Engine InnoDB wp_postmeta: Data: 2.52MB + Index: 3.03MB + Engine InnoDB wp_posts: Data: 0.41MB + Index: 0.38MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.13MB + Index: 0.08MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_toolset_associations: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_toolset_connected_elements: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_toolset_post_guid_id: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_toolset_relationships: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_toolset_type_sets: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.03MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_w3tc_cdn_pathmap: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_w3tc_cdn_queue: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.09MB + Index: 0.13MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB ### Post Type Counts ### attachment: 1004 custom_css: 2 customize_changeset: 26 page: 26 post: 1 product: 504 revision: 11 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (13) ### WPML Multilingual CMS: by OnTheGoSystems – 4.4.8 Homepage Control: by WooThemes – 2.0.3 Mollie Payments for WooCommerce: by Mollie – 6.0 Theme Customisations: by WooThemes – 1.0.0 Toolset Types: by OnTheGoSystems – 3.4.5 W3 Total Cache: by BoldGrid – 2.0.1 WooCommerce PayPal Checkout Gateway: by WooCommerce – 2.1.1 WooCommerce Stripe Gateway: by WooCommerce – 4.7.0 WooCommerce Multilingual: by OnTheGoSystems – 4.10.4 WooCommerce: by Automattic – 4.8.0 WPML Media: by OnTheGoSystems – 2.6.2 WPML String Translation: by OnTheGoSystems – 3.1.6 WPML Translation Management: by OnTheGoSystems – 2.10.4 ### Inactive Plugins (1) ### Jetpack by WordPress.com: by Automattic – 9.2.1 ### Dropin Plugins (1) ### advanced-cache.php: advanced-cache.php ### Settings ### API Enabled: – Force SSL: – Currency: EUR (€) Currency Position: left Thousand Separator: . Decimal Separator: , Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – ### WC Pages ### Shop base: #18 - /shop/ Cart: #21 - /cart/ Checkout: #24 - /checkout/ My account: #27 - /my-account/ Terms and conditions: ? Page not set ### Theme ### Name: Storefront Version: 3.1.0 Author URL: https://woocommerce.com/ Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ? ### Templates ### Overrides: – ### Action Scheduler ### Complete: 6 Oldest: 2021-01-05 20:15:47 +0000 Newest: 2021-01-09 19:44:26 +0000
I understand why there has not been a reaction of support yet. I did some digging in the code and the grouped-product functionality is basically implemented by a call to the get_children() function which is known for its horrible performance with more than a few dozen child posts. Besides the 8 seconds PHP crunching, the display of this single product causes around 4,3k queries to the MySQL database.
I don’t expect there to be any solution soon unless the WooCommerce development team decides to rewrite the grouped-product functionality from scratch. Page caching will not solve the problem, only mask it, and on a site where the language switches based on browser preferences and currency and tax-rates are dependent on the IP address, page caching will give its own head-aches.
I will mark this topic now as resolved. Not because the underlying problem is resolved, but because of the fundamental problem in WooCommerce which causes it, I don’t expect any workable solutions to pop up here.
- The topic ‘High CPU load with grouped product’ is closed to new replies.