码迷,mamicode.com
首页 > 数据库 > 详细

关于MySQL的TPS和QPS

时间:2015-08-12 21:42:34      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:mysql

TPS - Transactions Per Second(每秒传输的事物处理个数),这是指服务器每秒处理的事务数,支持事务的存储引擎如InnoDB等特有的一个性能指标。


计算方法:

TPS = (COM_COMMIT + COM_ROLLBACK)/UPTIME

use information_schema;
select VARIABLE_VALUE into @num_com from GLOBAL_STATUS where VARIABLE_NAME ='COM_COMMIT';
select VARIABLE_VALUE into @num_roll from GLOBAL_STATUS where VARIABLE_NAME ='COM_ROLLBACK';
select VARIABLE_VALUE into @uptime from GLOBAL_STATUS where VARIABLE_NAME ='UPTIME';
select (@num_com+@num_roll)/@uptime;




QPS - Queries Per Second(每秒查询处理量)同时适用与InnoDB和MyISAM 引擎 

计算方法:

QPS=QUESTIONS/UPTIME

use information_schema;
select VARIABLE_VALUE into @num_queries from GLOBAL_STATUS where VARIABLE_NAME ='QUESTIONS';
select VARIABLE_VALUE into @uptime from GLOBAL_STATUS where VARIABLE_NAME ='UPTIME';
select @num_queries/@uptime;


版权声明:本文为博主原创文章,未经博主允许不得转载。

关于MySQL的TPS和QPS

标签:mysql

原文地址:http://blog.csdn.net/jeffreynicole/article/details/47451043

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!