QPS:每秒的查询数 TPS:每秒的事物量 QPS的计算方法 Questions = SHOW GLOBAL STATUS LIKE 'Questions'; Uptime = SHOW GLOBAL STATUS LIKE 'Uptime'; QPS=Questions/Uptime 例如: mysql> show global status like 'questions'; +---------------+-----------+ | Variable_name | Value | +---------------+-----------+ | Questions | 449106827 | +---------------+-----------+ 1 row in set (0.00 sec)
mysql> show global status like 'uptime'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | Uptime | 238722 | +---------------+--------+ 1 row in set (0.00 sec)
mysql> select 449106827/238722 as 'QPS VALUE' from dual; +-----------+ | QPS VALUE | +-----------+ | 1881.2963 | +-----------+ 1 row in set (0.00 sec)
___________________________________________________________
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 例如: mysql> SHOW GLOBAL STATUS LIKE 'Com_commit'; +---------------+----------+ | Variable_name | Value | +---------------+----------+ | Com_commit | 71050554 | +---------------+----------+ 1 row in set (0.00 sec)
mysql> SHOW GLOBAL STATUS LIKE 'Com_rollback'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | Com_rollback | 537161 | +---------------+--------+ 1 row in set (0.00 sec)
mysql> SHOW GLOBAL STATUS LIKE 'Uptime'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | Uptime | 238827 | +---------------+--------+ 1 row in set (0.00 sec)
mysql> select (71050554+537161)/238827 as 'TPS VALUE' from dual; +-----------+ | TPS VALUE | +-----------+ | 299.7472 | +-----------+ 1 row in set (0.00 sec) |
免责声明:本站部分文章和图片均来自用户投稿和网络收集,旨在传播知识,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系我们及时修正或删除。谢谢!
始终以前瞻性的眼光聚焦站长、创业、互联网等领域,为您提供最新最全的互联网资讯,帮助站长转型升级,为互联网创业者提供更加优质的创业信息和品牌营销服务,与站长一起进步!让互联网创业者不再孤独!
扫一扫,关注站长网微信