Queries overloading MySQL
-
After updating to WordPress 4.2.2 on WPEngine, my site started crashing with a 502 error. The logs showed that the query was timing out when calling to widget I had created using Query Wrangler and deployed to my landing pages.
Here’s an example of the error
WordPress database error Lost connection to MySQL server during query for query \n\t\t\tSELECT meta_key\n\t\t\tFROM wp_2_postmeta\n\t\t\tGROUP BY meta_key\n\t\t\tORDER BY meta_key /* From [redalertpolitics.com/2014/02/26/indiana-university-reports-potential-data-exposure/] in [**SERVER_PATH**/wp-content/plugins/query-wrangler/includes/query.inc:436] */ made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/rap2/single.php'), dynamic_sidebar, call_user_func_array, WP_Widget->display_callback, Query_Wrangler_Widget->widget, qw_execute_query, qw_template_query, qw_make_fields_rows, qw_all_fields, apply_filters('qw_fields'), call_user_func_array, qw_field_meta_value, qw_get_meta_keys, referer: http://redalertpolitics.com/author/associatedpress/?listpage=24
This error would occur several times on the same page. Our theory was that each of the widgets was making a separate call to the meta_key table, and while each call was not very large in and of itself, multiple instances of that call were overloading the DB connection.
My postmeta table for that site has about 151,000 rows in it, which I know is a lot, but this problem hadn’t been occurring or crashing my site until I updated to 4.2.2, so I thought this would be the right place to discuss how any recent updates to WordPress might have affected QW’s ability to execute these queries, and to see if anyone else has encountered a similar problem.
I’ve had to disable the Query Wrangler plugins I had running on article pages until I can determine if this error can be fixed.
Thanks!
The topic ‘Queries overloading MySQL’ is closed to new replies.