mysql QPS(每秒查询量)、 TPS(每秒事务量)计算方法
2020-06-09 本文已影响0人
长孙俊明
QPS (Query per second) (每秒查询量)
TPS(Transaction per second) (每秒事务量,如果是InnoDB会显示,没有InnoDB就不会显示)
计算方法
QPS
Questions = SHOW GLOBAL STATUS LIKE 'Questions';
Uptime = SHOW GLOBAL STATUS LIKE 'Uptime';
QPS=Questions/Uptime
TPS
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