13.0.2 Crashed 20 core DB server
-
Customer updated the plugin 20 minutes ago to 13.0.2. 2.3 million entries in wp_statistics_visitor table. This query was enqueued 20 times – blocking eachother and effectively killing the database server.
# User@Host: dbname[dbname] @ localhost []
# Thread_id: 86507332 Schema: relrules QC_hit: No
# Query_time: 290.705604 Lock_time: 196.087331 Rows_sent: 0 Rows_examined: 0
# Rows_affected: 0 Bytes_sent: 0
SET timestamp=1606660741;
OPTIMIZE TABLEwp_statistics_visitor
;Optimize table is unsafe to run from a plugin. That is a task that should be monitored while running by a human being so it can be terminated in case it blocks too many requests.
It seems optimizing tables is happening all over the place – file:line number:
grep -nR optimizeTable * includes/class-wp-statistics-visitor.php:55: DB::optimizeTable(DB::table('visitor')); includes/class-wp-statistics-visitor.php:183: DB::optimizeTable(DB::table('visitor_relationships')); includes/admin/class-wp-statistics-admin-purge.php:37: DB::optimizeTable(DB::table('historical')); includes/admin/class-wp-statistics-admin-purge.php:69: DB::optimizeTable(DB::table('historical')); includes/admin/class-wp-statistics-admin-purge.php:147: DB::optimizeTable(DB::table('historical')); includes/class-wp-statistics-user-online.php:171: DB::optimizeTable(DB::table('useronline')); includes/class-wp-statistics-exclusion.php:102: DB::optimizeTable(DB::table('exclusions')); includes/class-wp-statistics-db.php:179: public static function optimizeTable($table_name) includes/class-wp-statistics-schedule.php:153: DB::optimizeTable(DB::table('visit')); includes/class-wp-statistics-schedule.php:233: DB::optimizeTable($table_name); includes/class-wp-statistics-pages.php:274: DB::optimizeTable(DB::table('pages')); includes/class-wp-statistics-search-engine.php:395: DB::optimizeTable(DB::table('search'));
Technically, the db server ran fine, but the webserver ran out of processes due to many open processes waiting for the optimize table or the table lock it caused.
- The topic ‘13.0.2 Crashed 20 core DB server’ is closed to new replies.