Work in the case of SQL optimization, often have such a problem, SQL has all the use of the index, the requested amount of data is small, the total amount of data is not large, there are still many slow query appearance (we stipulate is >20ms). This time we should pay attention to our concurrency, transaction locks, the situation.
For the game, DB has a lot of inserts, update can be said that many players will communicate with DB.
This article temporarily ignores IO utilization in the OS, network card traffic, CPU changes, how to view the MySQL part of the parameters
To view the number of transactions per second:
Show global status like ' Com_commit ';
Show global status like ' Com_rollback ';
Tps= (Com_commit+com_rollback)/seconds
To view the number of queries per second:
Mysqladmin status Remove QPS
Query SQL Execution Status:
Show Processlist; Intercepting SQL, executing State,
To view the number of connections:
Show status like ' threads% ';
threads_connected number of threads already open
Threads_running the active thread
This column more highlights: http://www.bianceng.cn/database/MySQL/
For MySQL high concurrency optimization experience can refer to: http://www.gxldan.com/archives/203.html
High performance MySQL third edition download link: http://vdisk.weibo.com/s/hhS9w
Production Environment Maintenance Reference: Http://www.mysqlops.com/2011/09/02/mysql-fault-manual.html
The above status script will be released later!