MySQL性能计算_MySQL

WBOY
풀어 주다: 2016-06-01 13:32:41
원래의
1137명이 탐색했습니다.

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
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿