ITPub博客

首页 > 数据库 > MySQL > mysql性能指标 tps/qps

mysql性能指标 tps/qps

原创 MySQL 作者:yleizzz 时间:2017-01-12 19:33:28 0 删除 编辑
1 tps/qps

tps: Transactions Per Second,每秒事务数;

qps: Queries Per Second每秒查询数;

方法1:基于  com_commit、com_rollback 计算tps,基于 questions  计算qps。

TPS = Com_commit/s + Com_rollback/s

其中,

Com_commit /s= mysqladmin extended-status --relative --sleep=1|grep -w Com_commit

Com_rollback/s = mysqladmin extended-status --relative --sleep=1|grep -w Com_rollback

QPS 是指MySQL Server 每秒执行的Query总量,通过Questions (客户的查询数目)状态值每秒内的变化量来近似表示,所以有:

QPS = mysqladmin extended-status --relative --sleep=1|grep -w Questions




详情 参考
http://www.tuicool.com/articles/FBNBfuq

----------------另一种方式求qps tps 通过加入uptime求值
方法一 基于 questions  计算qps,基于  com_commit  com_rollback 计算tps
questions = show global status like 'questions';
uptime = show global status like 'uptime';
qps=questions/uptime

com_commit = show global status like 'com_commit';
com_rollback = show global status like 'com_rollback';
uptime = show global status like 'uptime';
tps=(com_commit + com_rollback)/uptime





来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30127122/viewspace-2132361/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: mysql 复制3种模式
请登录后发表评论 登录
全部评论

注册时间:2015-02-03

  • 博文量
    101
  • 访问量
    184277