Created on 2015-Jan-02
Updated on 2015-Jan-02
If you're experiencing slow mysql performance--top showing mysqld high cpu usage. This command will help you track down what's going on at that specific time.
mysql -e "show processlist"
Of course you should also check your log files:
/var/lib/mysql/mysql-slow.log /var/lib/mysql/mysql-error.log
You'll also want to optimize your /etc/my.cnf: For a pretty good quick start, you can use this tool, Percona Configuration Wizard for MySQL