TPS/QPS/RT的关系及计算
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了TPS/QPS/RT的关系及计算相关的知识,希望对你有一定的参考价值。
参考技术A如果是对一个查询接口(单场景)压测,且这个接口内部不会再去请求其它接口,那么tps=qps,否则,tps不等于qps
jmeter聚合报告中,Throughput是用来衡量请求的吞吐量,也就是tps
tps=样本数/运行时间,
样本数即并发请求数,
运行时间=RT(响应时间)+tt(思考时间,think time)
即 Tps=并发数/(RT+tt)
eg1:100并发,RT0.2S,tt不控制=0,那么Tps=100/0.2=500tps
eg2:100并发,RT0.2S,如果使用Throughput Shaping Timer自动控制tt,即tt=0.8s,那么Tps=100/(0.2s+0.8s)=100tps
TPS/QPS
有很多人,自己TPS和QPS的关系都搞不清。如下为基本的查询方式是,与计算公式! 拿走不谢!
MariaDB [(none)]> show global status like ‘questions‘;
+---------------+----------+
| Variable_name | Value |
+---------------+----------+
| Questions | 70991770 |
+---------------+----------+
1 row in set (0.00 sec)
MariaDB [(none)]> show global status like ‘uptime‘;
+---------------+--------+
| Variable_name | Value |
+---------------+--------+
| Uptime | 485352 |
+---------------+--------+
1 row in set (0.00 sec)
Questions/ Uptime
QPS:146
MariaDB [(none)]> show global status like ‘com_commit‘;
+---------------+---------+
| Variable_name | Value |
+---------------+---------+
| Com_commit | 8960761 |
+---------------+---------+
1 row in set (0.00 sec)
MariaDB [(none)]> show global status like ‘com_rollback‘;
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_rollback | 117 |
+---------------+-------+
1 row in set (0.00 sec)
MariaDB [(none)]> show global status like ‘uptime‘;
+---------------+--------+
| Variable_name | Value |
+---------------+--------+
| Uptime | 485432 |
+---------------+--------+
1 row in set (0.00 sec)
Com_commit + Com_rollback / Uptime
TPS:18
以上是关于TPS/QPS/RT的关系及计算的主要内容,如果未能解决你的问题,请参考以下文章