My website today suddenly became slow and all requests were taking about 2 seconds to complete. Usually it takes like 0.2 second I checked available space on disk and I have a lot.

Memory and CPU usage are usual nothing weird, error log is empty.

Tried to login to MySQL using the following command:

mysql -u root -p

it says "Enter Password" then after I enter the password it takes forever.

then I decided to restart mysql sudo service mysql restart and it removed the slowness and fixed the problem which I hate, because I don't know what was the problem and how to avoid that in the future or fix.

What do I need to look at in this case, how to get more information about that issue?

  • 1
    You want to monitor performance data about your database, generally gather as much information as possible, before you take the step of restarting. Most useful information is gone then. A good start is probably percona's monitoring, which you can easily run in a docker container: percona.com/doc/percona-monitoring-and-management/index.html
    – tombom
    Jun 18 '19 at 15:04
  • slow query log. Will find you some queries. EXPLAIN {query}, SHOW CREATE TABLE {tablename} from queries. Edit question with this information. Also query profile.
    – danblack
    Jun 19 '19 at 0:01
  • @tombom Thanks I will take a look on that, I had to restart visitors were complaining of that issue.
    – Adam
    Jun 19 '19 at 11:49
  • @danblack mysql isn't responsive at all, which prevented me from doing such queries
    – Adam
    Jun 19 '19 at 11:51
  • Additional information request. Post on pastebin.com and share the links. RAM size of your MySQL Host server A) complete (not edited) my.cnf or my.ini Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; E) complete MySQLTuner report F) SHOW ENGINE INNODB STATUS; AND very helpful information, if available includes - htop OR top OR mytop for most active apps, ulimit -a for a linux/unix list of limits, iostat -xm 5 3 for IOPS by device and core/cpu count, for server workload tuning analysis. Jun 21 '19 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.