Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Load Testing Tool #105

Open
hhstore opened this issue Sep 14, 2018 · 3 comments
Open

Load Testing Tool #105

hhstore opened this issue Sep 14, 2018 · 3 comments

Comments

@hhstore
Copy link
Owner

hhstore commented Sep 14, 2018

@hhstore hhstore added Test Tool Python python 3.5+ (3.6, 3.7) labels Sep 14, 2018
@hhstore hhstore mentioned this issue Mar 18, 2019
3 tasks
@hhstore
Copy link
Owner Author

hhstore commented Mar 20, 2019

参考:

术语说明:
QPS = req/sec = 请求数/秒

【QPS计算PV和机器的方式】

QPS统计方式 [一般使用 http_load 进行统计]
QPS = 总请求数 / ( 进程总数 *   请求时间 )
QPS: 单个进程每秒请求服务器的成功次数

单台服务器每天PV计算:

公式1:每天总PV = QPS * 3600 * 6
公式2:每天总PV = QPS * 3600 * 8

服务器计算:

服务器数量 =   ceil( 每天总PV / 单台服务器每天总PV )

【峰值QPS和机器计算公式】

原理:每天80%的访问集中在20%的时间里,这20%时间叫做峰值时间公式:( 总PV数 * 80% ) / ( 每天秒数 * 20% ) = 峰值时间每秒请求数(QPS)

机器:峰值时间每秒QPS / 单台机器的QPS   = 需要的机器问:每天300w PV 的在单台机器上,这台机器需要多少QPS?答:( 3000000 * 0.8 ) / (86400 * 0.2 ) = 139 (QPS)

问:如果一台机器的QPS是58,需要几台机器来支持?
答:139 / 58 = 3



测试案例:

django 并发测试:

测试机器:四核,4GB内存
系统环境:Ubuntu 14.04 LTS
测试环境:django
测试工具:apache ab
测试参数:1000个并发 1000~10000个请求

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant