Reply 287491 to: Errors upon loading some of the pages on our website

Avatar: blueoceanagency
Гочо Симеонов
Participant
May 14, 2021 at 09:48

hello, we have an answer from the hosting company:
“Hello,

I have checked the information provided and I would like to clarify the following:

– Your site currently has a memory_limit value of 521MB. This is too high and increasing it is not recommended. Even if it is increased, the limits for the time for execution of scripts in the shared hosting service are reached again. You need to track the cause of this consumption and take measures to reduce it.

– On 05.05.2021. a number of changes have been made to the system on your part. It is from this date that the CPU time spent by the account has drastically increased and 67% of the provided monthly resource has already been spent. You will find statistics through your client profile on our site -> “Hosting accounts” -> “Details” -> “Advanced system parameters” -> “Details”.

Here you can see that a drastic jump has been reported in MySQL time spent, which is not typical for WordPress. At the end of the email you will find the suboptimal sql request, which is saved in the server logs.

The request processes over 13 million lines in each execution (Rows_examined: 13211883) and takes 26 seconds to complete. It is necessary to review as a priority the request and the functionalities of the theme and the store that launch it and to take measures for its optimization. Usually, with a well-structured query, the goal is to process the optimal number of rows. For this purpose, indexes can be added to the tables or the query can be reworked.

I expect feedback from you after we take measures to optimize the request and reduce the process time spent by the account.

Here is the request:
—————
# Time: 210513 18:30:00
# User@Host: arnicagr_wp2559[arnicagr_wp2559] @ localhost []
# Thread_id: 643440 Schema: arnicagr_wp2559 QC_hit: No
# Query_time: 26.270383 Lock_time: 0.000232 Rows_sent: 440064 Rows_examined: 13211883
# Rows_affected: 0 Bytes_sent: 4400718
SET timestamp=1620919800;
SELECT ID FROM 52T_posts as p
INNER JOIN 52T_postmeta pm
on p.ID = pm.post_id
and pm.meta_key=’_sale_price’
AND pm.meta_value != ”
AND p.post_status = ‘publish’
AND p.post_type = ‘product’
AND p.ID IN ( SELECT 52T_term_relationships.object_id FROM 52T_term_relationships WHERE term_taxonomy_id IN (198) ) AND p.ID NOT IN ( SELECT tr.object_id
FROM 52T_terms as t
JOIN 52T_term_taxonomy AS tt ON t.term_id = tt.term_id
JOIN 52T_term_relationships AS tr ON tt.term_taxonomy_id = tr.term_taxonomy_id WHERE t.name = ‘exclude-from-catalog’)
OR p.ID IN (
SELECT p.post_parent as parent_id FROM 52T_posts AS p
INNER JOIN 52T_postmeta AS meta ON p.ID = meta.post_id
AND p.post_type = ‘product_variation’
AND p.post_status = ‘publish’
AND meta.meta_key = ‘_sale_price’
AND meta.meta_value != ”
AND p.post_parent IN ( SELECT 52T_term_relationships.object_id FROM 52T_term_relationships WHERE term_taxonomy_id IN (198) ) AND p.post_parent NOT IN ( SELECT tr.object_id
FROM 52T_terms as t
JOIN 52T_term_taxonomy AS tt ON t.term_id = tt.term_id
JOIN 52T_term_relationships AS tr ON tt.term_taxonomy_id = tr.term_taxonomy_id WHERE t.name = ‘exclude-from-catalog’)

);
—————“

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.