http://tech.noredink.com/post/133347435578/optimizing-mysql-for-high-concurrency-on-amazon
Looking for concurrency bottlenecks
performance schema
List the total maximum wait by event inside of InnoDB
SELECT EVENT_NAME, SUM_TIMER_WAIT/1000000000 WAIT_MS, COUNT_STAR FROM performance_schema.events_waits_summary_global_by_event_name ORDER BY SUM_TIMER_WAIT DESC, COUNT_STAR DESC LIMIT 30;
List current and last wait events on InnoDB. -- “what the current, or last completed, wait for each session was, and for exactly how long they waited” SELECT NAME, IF(PPS.
https://medium.com/devoops-and-universe/database-performance-aws-vs-bare-metal-452f64481b07
https://mariadb.com/kb/en/mariadb/performance-schema-overview/
mysql -h xxx.xxx.xxx.xxx -u root -pxxxooo -e “set GLBAL server_id=xxxooo "
mysql -h xxx.xxx.xxx.xxx -u root -pxxxooo -e “show variables like ‘server_id’”
http://imysql.com/2015/05/24/mysql-optimization-reference-1.shtml
http://imysql.com/2015/05/29/mysql-optimization-reference-2.shtml
http://www.ywnds.com/?p=7488
http://imysql.com/2016/11/30/mysql-faq-find-who-cause-mysql-swap.shtml
free -gt 查看内存、SWAP消耗情况
尤其是参加过 知数堂培训MySQL DBA优化班课程 的同学应该都知道,我们在课上多次强调:遇到这种情况,第一条件反射很直接就是:发生内存泄露(memory leak)了。
一般来说,如果发现内存统计结果中,cached和used 相差特别大的话,基本可确定系统发生内存泄露。相应的处理手法有:
治标的办法:择机重启进程,彻底释放内存归还给OS;
治本的办法:找到代码中导致泄露的代码,修复之(我们这次面对的是mysql代码,还是去官方提交bug吧,哈哈);
治本的办法:升级程序版本,通常新版本会解决旧版本存在的问题,推荐此方案。
物理内存还有不少空闲,但把swap都耗尽了。同样滴,这种案例在我们知数堂的MySQL DBA培训课程里也被多次谈及,绝大多数情况是因为没有关闭NUMA引起的。在运行数据库进程的服务器上,强烈建议关闭NUMA,在之前的分享 比较全面的MySQL优化参考(上篇) 中也有提及。
http://www.ywnds.com/?p=7499