View the running mysql status

Source: Internet
Author: User
Welcome to the Linux community forum, and interact with 2 million technical staff to enter the running mysql status to view the running mysql monitoring, one of which is to view the mysql running status. (1) QPS (queries per second) QPSQuestions (orQueries) secondsmysqlshowglobalstatuslikeQuestion %;

Welcome to the Linux community forum, interact with 2 million technical staff> go to the running mysql status to view the running mysql monitoring, one of which is to view the mysql running status. (1) QPS (Queries per second) QPS = Questions (or Queries)/seconds mysql show global status like 'Question % ';

Welcome to the Linux community forum and interact with 2 million technicians>

View the running mysql status

Monitor running mysql. one of the following methods is to view the running status of mysql.

  

(1) QPS (queries per second)

QPS = Questions (or Queries)/seconds

Mysql> show global status like 'Question % ';

(2) TPS (transaction volume per second)

TPS = (Com_commit + Com_rollback)/seconds

Mysql> show global status like 'com _ commit ';

Mysql> show global status like 'com _ rollback ';

(3) key Buffer hit rate

Mysql> show global status like 'key % ';

Key_buffer_read_hits = (1-key_reads/key_read_requests) * 100%

Key_buffer_write_hits = (1-key_writes/key_write_requests) * 100%

(4) InnoDB Buffer hit rate

Mysql> show status like 'innodb _ buffer_pool_read % ';

Innodb_buffer_read_hits = (1-innodb_buffer_pool_reads/innodb_buffer_pool_read_requests) * 100%

(5) Query Cache hit rate

Mysql> show status like 'qcache % ';

Query_cache_hits = (Qcahce_hits/(Qcache_hits + Qcache_inserts) * 100%;

(6) Number of Table Cache statuses

Mysql> show global status like 'open % ';

Compare open_tables and opend_tables values

(7) Thread Cache hit rate

Mysql> show global status like 'thread % ';

Mysql> show global status like 'connections ';

Thread_cache_hits = (1-Threads_created/connections) * 100%

(8) Lock status

Mysql> show global status like '% lock % ';

Table_locks_waited/Table_locks_immediate = 0.3% if the ratio is large, it indicates that the table lock causes serious blocking.

Innodb_row_lock_waits innodb row lock, which is too large and may be caused by a gap lock

(9) replication latency

Mysql> show slave status

View latency

(10) Tmp Table Status (temporary Table status)

Mysql> show status like 'create _ tmp % ';

The Created_tmp_disk_tables/Created_tmp_tables ratio should not exceed 10%. If the value of Created_tmp_tables is large,

It may be that too many sentences are sorted or sentences are not optimized enough.

(11) Binlog Cache Usage

Mysql> show status like 'binlog _ cache % ';

If the Binlog_cache_disk_use value is not 0, you may need to increase the binlog_cache_size.

(12) Innodb_log_waits volume

Mysql> show status like 'innodb _ log_waits ';

If the Innodb_log_waits value is not equal to 0, it indicates that innodb log buffer is waiting because of insufficient space.

For example, the command:

> # Show global status;

Although you can use:

> # Show global status like %... %;

But it is necessary to find out what each item means for a long list.

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.