Plesk for Linux
kb: technical
ABT: Group B
Applicable to:
- Plesk for Linux
Symptoms
- Plesk and websites are not accessible or working slow due to high CPU load by MySQL processes
- Slow MySQL queries are shown by the following command:
# plesk db "SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY TIME ASC \G"
ID: 444047
USER: johndoe
HOST: localhost
DB: ExampleDB
COMMAND: Query
TIME: 300 - On CloudLinux, dbtop utility shows a user as restricted:
CONFIG_TEXT: restricted 196/237/203 10761/11833/32292 0/2362/2936 R/c:cpu/30
Cause
Slow MySQL queries generate high CPU usage on the server
Resolution
- Log in to Plesk server via SSH
- Identify the slowest queries:
# plesk db "SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY TIME ASC \G"
Id: 444047
User: johndoe
Host: localhost
db: ExampleDB
Command: Query
Time: 300
State: Sending data -
Log in to Plesk and go to Tools & Settings > Database servers > click on the number of databases:
- Identify the subscription associated with the database from step 2
- Kill the slow queries by their ID from step 2:
# plesk db "kill ID"
- Suspend the subscription where the identified database is registered to decrease CPU load
- Contact website developers to review slow SQL queries and fix the issue
Additional information
Troubleshooting slow performance of the MySQL on Plesk server
Comments
1 comment
Hi, show me this:
root@plesk:~# plesk db "SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY TIME ASC \G"
exec: "less": executable file not found in $PATH
How to check it?
Please sign in to leave a comment.