对应fetches/sec,即每秒的响应请求数,也即是最大吞吐能力。每天80%的访问集中在20%的时间里,这20%时间叫做峰值时间。一般需要达到139QPS,因为是峰值。
计算关系:
QPS=并发量/平均响应时间。
汪做誉并发量=QPS*平均响应时间。
mysql每猜腔秒查询结果数qps怎么得到(1)QPS(每秒Query量)
QPS = Questions(or Queries) / seconds
mysql >show global status like 'Question%'
(2)TPS(每秒事务量)
TPS = (Com_commit + Com_rollback) / seconds
mysql >show global status like 'Com_commit'
mysql >show global status like 'Com_rollback'
(3)key Buffer 命中率
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命中率
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命中率
mysql>show status like 'Qcache%'
Query_cache_hits = (Qcahce_hits / (Qcache_hits + Qcache_inserts )) * 100%
(6)Table Cache状态量
mysql>show global status like 'open%'
比较 open_tables 与 opend_tables 值
(7)Thread Cache 命中率
mysql>show global status like 'Thread%'
mysql>show global status like 'Connections'
Thread_cache_hits = (1 - Threads_created / connections ) * 100%
(8)锁定状态
mysql>show global status like '%lock%'
Table_locks_waited/Table_locks_immediate=0.3% 如果这个比值比较大的话,说明表锁造成的阻塞比较严重
Innodb_row_lock_waits innodb行锁,穗中衫太大可能是间隙锁造成的
(9)复制培行延时量
mysql >show slave status
查看延时时间
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)