Comments (5)
可以给一下计算公式吗,代码中我看到有 除一个协程数, 我把协程数乘回去刚好符合自己的预测
from go-stress-testing.
本项目是并发压测的
QPS = 服务器每秒钟处理请求数量 (req/sec 请求数/秒)
定义:单个协程耗时T, 所有协程压测总时间 sumT,协程数 n
如果:只有一个协程,假设接口耗时为 2毫秒,每个协程请求了10次接口,每个协程耗总耗时2*10=20毫秒,sumT=20
QPS = 10/20*1000=500
如果:只有十个协程,假设接口耗时为 2毫秒,每个协程请求了10次接口,每个协程耗总耗时2*10=20毫秒,sumT=20*10
=200
QPS = 100/(200/10)*1000=5000
上诉两个示例现实中总耗时都是20毫秒,示例二 请求了100次接口,QPS应该为 示例一 的10倍,所以示例二的实际总QPS为5000
除以协程数的意义是,sumT是所有协程耗时总和
from go-stress-testing.
好的,明白了,谢啦
from go-stress-testing.
QPS = 100/(200/10)*1000=5000
你的并发数每次都是固定的并发数去计算的 应该是动态实际请求的并发协程数去计算吧 用chanIDLen才对吧?
from go-stress-testing.
QPS = 100/(200/10)*1000=5000
你的并发数每次都是固定的并发数去计算的 应该是动态实际请求的并发协程数去计算吧 用chanIDLen才对吧?
@yyltesting 目前使用的是固定的并发数计算的
- 如果是使用动态协程数 chanIDLen 计算QPS,会导致QPS比较高
程序是先启动协程,每个协程开始并发请求服务端,类似于"跑马"效果,如果使用 动态协程数,最早的 QPS 是就会使用跑马最快的一个或者是几个计算QPS
会导致平均耗时很低(跑马中最快的),QPS 会虚高
- QPS 应该是压测一段时间,并发数一定 QPS 稳定在一个数值的访问才是在该并发下服务端的实际QPS
- 所以,这里使用的是固定并发数计算的更合理
from go-stress-testing.
Related Issues (20)
- header错误 HOT 3
- Html report HOT 1
- websocket压测并发数上限为1万
- 发起websocket为什么需要暂停?而且暂停时间是1秒写的60秒 HOT 2
- go-stress不能测试get吗 HOT 1
- 可以支持从文件加载body吗?类似ab的-p参数 HOT 1
- websocket 协议没有透传header HOT 2
- 为什么接受数据使用channel接收数据缓存 HOT 1
- 发送http请求收到的body为空 HOT 3
- 支持 http proxy 和 socks5 proxy 吗? HOT 1
- 执行curl文件不能正确加载host HOT 1
- mac 无法安装 HOT 1
- GC相关的问题
- v1.0.6 的 exe 闪退 HOT 1
- 增加龙架构(loong64)的支持 HOT 1
- 溢出bug HOT 1
- mac intel x64 HOT 3
- 工具使用问题 HOT 1
- 如何不限制时长压测 HOT 6
- 可以支持并发多个请求吗 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-stress-testing.