MySQL parsing under high concurrency

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.