Home > Database > Mysql Tutorial > MySQL性能计算_MySQL

MySQL性能计算_MySQL

WBOY
Release: 2016-06-01 13:32:41
Original
1164 people have browsed it

bitsCN.com

MySQL性能计算

 

##################################################################################

 

QPS(Queries Per Second):

 

mysql> show /*!50000 global */ status like 'Questions';

 

mysql> show /*!50000 global */ status like 'Queries';

 

 

QPS = Questions(or Queries) / Seconds

 

##################################################################################

 

TPS(Transactions Per Second):

 

 

mysql> show status like 'Com_commit';

 

mysql> show status like 'Com_rollback';

 

 

#分布式事务相关应加上下面2个变量值

 

mysql> show status like 'Com_xa_commit';

 

mysql> show status like 'Com_xa_rollback';

 

 

TPS = ( Com_commit + Com_rollback ) / Seconds

 

 

 

##################################################################################

 

 

Key Buffer(MyISAM表索引Cache):

 

 

mysql> show status like 'Key_reads';

 

mysql> show status like 'Key_read_requests';

 

mysql> show status like 'Key_writes';

 

mysql> show status like 'Key_write_requests';

 

 

Key Buffer Read 命中率 = ( 1 - Key_reads / Key_read_requests ) * 100%

 

Key Buffer Write 命中率 = ( 1 - Key_writes / Key_write_requests ) * 100%

 

 

##################################################################################

 

 

Innodb Buffer Pool:

 

 

mysql> show status like 'Innodb_buffer_pool_reads';

 

mysql> show status like 'Innodb_buffer_pool_read_requests';

 

 

 

Innodb Buffer Pool Read 命中率 = ( 1 - Innodb_buffer_pool_reads/Innodb_buffer_pool_read_requests )  * 100%

 

 

mysql> show innodb status /G

 

 

##################################################################################

 

 

Query Cache:

 

 

mysql> show status like 'Qcache_hits';

 

mysql> show status like 'Qcache_inserts';

 

 

Query Cache 命中率 = ( Qcache_hits / ( Qcache_hits + Qcache_inserts ) ) * 100%;

 

 

##################################################################################

 

Table Cache:

 

mysql> show status like 'Open_tables';

 

mysql> show status like 'Opened_tables';

 

Table Cache 命中率 = ( Open_tables / Opened_tables ) * 100%

 

##################################################################################

 

Thread Cache:

 

 

mysql> show status like 'connections';

 

mysql> show status like 'Threads_created';

 

 

Thread Cache 命中率 = ( 1 - Threads_created / Connections ) * 100%

 

#################################################################################

bitsCN.com
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template