Applicable to:
- Plesk for Linux
Symptoms
- Database importing hangs at 100%. The database is not big.
- MySQL server significantly loads CPU:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
16164 mysql 20 0 2654656 748200 8044 S 201.0 18.3 2698:08 mysqld - Errors in
/var/log/mysql/error.log:
275998 [Note] Aborted connection 275998 to db: 'psa' user: 'admin' host: 'localhost' (Got an error reading communication packets)
- MySQL process list shows the following:
show full processlist;
| 255327 | word_user1 | localhost | word_name1 | Query | 42625 | Waiting for table metadata lock | SELECT COUNT(*) FROM `word_name1`.`wp_wfConfig` |
| 255334 | word_user1 | localhost | word_name1 | Query | 42621 | Waiting for table metadata lock | SELECT COUNT(*) FROM `word_name1`.`wp_wfConfig` |
| 255512 | word_user1 | localhost | word_name1 | Query | 42288 | Waiting for table metadata lock | SELECT COUNT(*) FROM `word_name1`.`wp_wfConfig` |
Cause
Metadata locks due to non-optimized client databases.
Resolution
Optimize the client databases and adjust MySQL instance following the instructions from article MySQL performance is slow. How to improve it? .