首页 > 数据库 > MySQL > mysql性能指标 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
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30127122/viewspace-2132361/ ,如需转载,请注明出处,否则将追究法律责任。