Crashing SQL Server due to excessive requests

Posted in: Newspaper
Post count: 1

There’s a lots of request made to the SQL Database requested at the same time thus rate limiting issue is happening on the site.

https://downloads.intercomcdn.com/i/o/998988044/d3c2ccb5d4ea63956a683f0c/Screenshot+2024-03-22+at+10_55_47%E2%80%AFAM.png

WordPress database error MySQL server has gone away for query SELECT post_id, meta_value FROM 3cEugTXx_postmeta WHERE meta_key = ‘_wp_attached_file’ AND meta_value = ‘https://noticiasnrt.mystagingwebsite.com/wp-content/uploads/2022/01/BackS-300×169-1.png’ made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, cnfp_template_redirect, include(‘/plugins/colorlib-404-customizer/includes/colorlib-template.php’), get_header, locate_template, load_template, require_once(‘/themes/Newspaper/header.php’), do_action(‘tdc_header’), WP_Hook->do_action, WP_Hook->apply_filters, {closure}, require_once(‘/plugins/td-composer/legacy/Newspaper/header.php’), wp_head, do_action(‘wp_head’), WP_Hook->do_action, WP_Hook->apply_filters, td_background->wp_head_hook_background_logic, attachment_url_to_postid

WordPress database error MySQL server has gone away for query SELECT post_id, meta_value FROM 3cEugTXx_postmeta WHERE meta_key = ‘_wp_attached_file’ AND meta_value = ‘https://noticiasnrt.mystagingwebsite.com/wp-content/uploads/2022/01/BackS-300×169-1.png’ made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/plugins/td-cloud-library/wp_templates/tdb_view_single.php’), get_header, locate_template, load_template, require_once(‘/themes/Newspaper/header.php’), do_action(‘tdc_header’), WP_Hook->do_action, WP_Hook->apply_filters, {closure}, require_once(‘/plugins/td-composer/legacy/Newspaper/header.php’), wp_head, do_action(‘wp_head’), WP_Hook->do_action, WP_Hook->apply_filters, td_background->wp_head_hook_background_logic, attachment_url_to_postid

One thing we’ve identified is that the Newspaper theme is making some very lengthy and expensive database queries that slow down page loads and may be contributing to elevated SQL CPU usage.
For example, on the homepage the Newspaper theme runs the following code.
require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/plugins/td-composer/legacy/Newspaper/page.php’), get_header, locate_template, load_template, require_once(‘/themes/Newspaper/header.php’), do_action(‘tdc_header’), WP_Hook->do_action, WP_Hook->apply_filters, {closure}, require_once(‘/plugins/td-composer/legacy/Newspaper/header.php’), wp_head, do_action(‘wp_head’), WP_Hook->do_action, WP_Hook->apply_filters, td_background->wp_head_hook_background_logic, attachment_url_to_postid
Which also executes the following query.
SELECT post_id, meta_value FROM 3cEugTXx_postmeta WHERE meta_key = ‘_wp_attached_file’ AND meta_value = ‘https://noticiasnrt.com/wp-content/uploads/2022/01/BackS-300×169-1.png’
This is a very expensive and lengthy query, especially on a site of this size.
In some cases, it might take over 2 seconds for that code and query to complete because it is not optimized and likely doesn’t have database indexes that would help speed it up.

it seems that the problem originates from the td-composer plugin. Would it be alright if I deactivate it temporarily?
PHP Fatal error: Uncaught Error: Failed opening required ‘/srv/htdocs/wp-content/plugins/td-composer/legacy/common/wp_booster/td_page_views.php’ (include_path=’/:.’) in /wordpress/core/6.4.3/wp-includes/template.php:790 Stack trace: #0 /srv/htdocs/wp-content/plugins/td-composer/legacy/common/wp_booster/td_autoload_classes.php(42): load_template(‘/srv/htdocs/wp-…’, true) #1 /srv/htdocs/wp-content/plugins/td-cloud-library/wp_templates/tdb_view_single.php(111): td_autoload_classes->loading_classes(‘td_page_views’) #2 /wordpress/core/6.4.3/wp-includes/template-loader.php(106): include(‘/srv/htdocs/wp-…’) #3 /wordpress/core/6.4.3/wp-blog-header.php(19): require_once(‘/wordpress/core…’) #4 /wordpress/core/6.4.3/index.php(17): require(‘/wordpress/core…’) #5 {main} thrown in /wordpress/core/6.4.3/wp-includes/template.php on line 790

Post count: 21065

Hello!

We’ve discussed this issue here:
https://forum.tagdiv.com/topic/theme-causing-high-cpu-usage-2/
https://forum.tagdiv.com/topic/sql-querys-high-cpu/
The tagdiv composer is the main plugin of the theme and contains a lot of features and multiple options in order to customize your website. Without it, the cloud templates are not displaying at all. I recommend using fewer features: https://forum.tagdiv.com/what-is-ajax-preloading/ and try to optimize your website. Please make sure that all the requirements are met, as you can see here: https://forum.tagdiv.com/requirements-for-newspaper/
I also recommend to use the latest update of the theme and plugins.
Our developers are aware of this issue and try to synthesize the composer in each update, which is big, and fix the major problems of the theme and speed.

Thank you!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.