Query issues – how to diagnose?
-
I have a WordPress install on a dedicated server with decent memory (upwards of 8GB)
Since upgrading to 3.8, I started getting mysql disconnects/timeouts, better known as
MySQL server has gone away
I enabled error_log for a bit, i.e.
ini_set('log_errors',TRUE); ini_set('error_reporting', E_ALL); ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
This resulted in an immense file – basically the error_log grows by about a GB every 4 minutes or so.
I AM caching queries
query_cache_type = 1 query_cache_limit = 8M query_cache_size = 512M
I was able to temporarily fix the issue by setting
max_allowed_packet = 16M
Then I installed Debug Bar and checked queries on homepage. Debug Bar tells me there are 729 queries!
The slow ones are:
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'
require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), wp_not_installed, is_blog_installed, wp_load_alloptions #1
7.5msUPDATE
wp_optionsSET
option_value...WHERE
option_name= 'wpseo_titles'
require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/weaver-ii-pro/page.php’), weaverii_get_header, get_header, locate_template, load_template, require_once(‘/themes/weaver-ii-pro/header.php’), wp_title, apply_filters(‘wp_title’), call_user_func_array, WPSEO_Frontend->title, apply_filters(‘wpseo_title’), call_user_func_array, WPSEO_Frontend->title_test_helper, update_option
55.0msUPDATE
wp_optionsSET
option_value...WHERE
option_name= 'wpseo_titles'
require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/weaver-ii-pro/page.php’), weaverii_get_header, get_header, locate_template, load_template, require_once(‘/themes/weaver-ii-pro/header.php’), wp_head, do_action(‘wp_head’), call_user_func_array, Facebook_Open_Graph_Protocol::add_og_protocol, apply_filters(‘fb_meta_tags’), call_user_func_array, WPSEO_OpenGraph->facebook_filter, WPSEO_OpenGraph->og_title, WPSEO_Frontend->title, apply_filters(‘wpseo_title’), call_user_func_array, WPSEO_Frontend->title_test_helper, update_option
56.4msUPDATE
wp_optionsSET
option_value...WHERE
option_name= 'wpseo_titles'
require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/weaver-ii-pro/page.php’), weaverii_get_footer, get_footer, locate_template, load_template, require_once(‘/themes/weaver-ii-pro/footer.php’), wp_footer, do_action(‘wp_footer’), call_user_func_array, WPSEO_Frontend->flush_cache, WPSEO_Frontend->title, apply_filters(‘wpseo_title’), call_user_func_array, WPSEO_Frontend->title_test_helper, update_option
56.0msSELECT option_value FROM wp_options WHERE option_name = 'dismissed_update_core' LIMIT 1
require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/weaver-ii-pro/page.php’), weaverii_get_footer, get_footer, locate_template, load_template, require_once(‘/themes/weaver-ii-pro/footer.php’), wp_footer, do_action(‘wp_footer’), call_user_func_array, wp_admin_bar_render, do_action_ref_array, call_user_func_array, wp_admin_bar_updates_menu, wp_get_update_data, get_core_updates, get_site_option, get_option
9.6msI do have lots (~50) plugins installed, and I use Weaver II Pro theme. Most of these plugins are essential to get what I need out of WordPress (I use WordPress as a CMS). This is a live install so I can’t really disable everything and then enable one by one to see what’s breaking things (if not core). Is there another way to figure out the problem by looking at the Debug Bar’s output?
- The topic ‘Query issues – how to diagnose?’ is closed to new replies.