ab测试 uwsgi遇到的问题
1 请求并发数目较大时,接收到的数目小于发送的数目
1.1
描述:uwsgi正常返回302跳转
ab -n 5000 -c 250 -g test.log "192.168.50.20:9033/Mapping.do?×××××××&as=1234567"
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.50.20 (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Finished 5000 requests
Server Software:
Server Hostname: 192.168.50.20
Server Port: 9033
Document Path: /Mapping.do?bfd_nid=behe&as=1234567
Document Length: 0 bytes
Concurrency Level: 250
Time taken for tests: 12.107652 seconds
Complete requests: 5000
Failed requests: 0
Write errors: 0
Non-2xx responses: 4990
Total transferred: 2095800 bytes
HTML transferred: 0 bytes
Requests per second: 412.96 [#/sec] (mean)
Time per request: 605.383 [ms] (mean)
Time per request: 2.422 [ms] (mean, across all concurrent requests)
Transfer rate: 168.98 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 42.5 0 3000
Processing: 18 466 1595.9 151 12083
Waiting: 0 446 1536.9 150 12083
Total: 18 467 1601.7 151 12106
Percentage of the requests served within a certain time (ms)
50% 151
66% 165
75% 198
80% 251
90% 389
95% 485
98% 9008
99% 12036
100% 12106 (longest request)
按照上边的结果所示,发送了5000个请求,4990个非2xx相应(Non-2xx responses: 4990)
而查看uwsgi.log发现也只接收到4990个请求。
1.2 只要降低并发就不会出现这样的问题
ab -n 50000 -c 100 -g test.log "192.168.50.20:9033/Mapping.do?bfd_nid=behe&as=1234567"
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.50.20 (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Finished 50000 requests
Server Software:
Server Hostname: 192.168.50.20
Server Port: 9033
Document Path: /Mapping.do?bfd_nid=behe&as=1234567
Document Length: 0 bytes
Concurrency Level: 100
Time taken for tests: 85.735172 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Non-2xx responses: 50000
Total transferred: 21000000 bytes
HTML transferred: 0 bytes
Requests per second: 583.19 [#/sec] (mean)
Time per request: 171.470 [ms] (mean)
Time per request: 1.715 [ms] (mean, across all concurrent requests)
Transfer rate: 239.19 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.0 0 186
Processing: 4 170 123.1 136 1592
Waiting: 4 170 123.0 136 1592
Total: 4 170 123.1 136 1592
Percentage of the requests served within a certain time (ms)
50% 136
66% 148
75% 159
80% 169
90% 265
95% 403
98% 540
99% 650
100% 1592 (longest request)
1.3 调大listen参数解决问题。
当listen参数变大时,可以提高并发的数目。按道理增大processes数量和增大listen队列长度都可以增大并发能力。但是好像使用listen参数,效果比较显著。难道是后端处理速度太慢,需要缓存更多?
uwsgi.ini:
[uwsgi]
http=0.0.0.0:9033
master=true
pythonpath=../
module=api
processes=30
listen=512
daemonize=uwsgi.log
pidfile=uwsgi.pid
vacuum=true
harakiri=5
harakiri-verbose=true
buffer-size=16384
2
uwsgi.ini:
[uwsgi]
#http=192.168.40.11:9034
http=0.0.0.0:9034
master=true
pythonpath=../
module=breapi
processes=32
listen=512
daemonize=./logs/uwsgi.log
pidfile=uwsgi.pid
vacuum=true
harakiri=5
harakiri-verbose=true
buffer-size=16384
stats = $(HOSTNAME):1734
测试:
ab -n 30000 -c 1000 -g test.log "192.168.40.11:9034/Mapping.do?bfd_nid=behe&as=1234567"
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.40.11 (be patient)
Completed 3000 requests
Completed 6000 requests
Completed 9000 requests
Completed 12000 requests
Completed 15000 requests
Completed 18000 requests
Completed 21000 requests
Completed 24000 requests
Completed 27000 requests
Finished 30000 requests
Server Software:
Server Hostname: 192.168.40.11
Server Port: 9034
Document Path: /Mapping.do?bfd_nid=behe&as=1234567
Document Length: 0 bytes
Concurrency Level: 1000
Time taken for tests: 12.411582 seconds
Complete requests: 30000
Failed requests: 0
Write errors: 0
Non-2xx responses: 29994
Total transferred: 12597480 bytes
HTML transferred: 0 bytes
Requests per second: 2417.10 [#/sec] (mean)
Time per request: 413.719 [ms] (mean)
Time per request: 0.414 [ms] (mean, across all concurrent requests)
Transfer rate: 991.17 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 4 99.8 0 3000
Processing: 43 299 983.0 126 9234
Waiting: 0 297 976.9 125 9234
Total: 50 304 993.5 126 12070
Percentage of the requests served within a certain time (ms)
50% 126
66% 129
75% 132
80% 134
90% 141
95% 616
98% 3222
99% 3632
100% 12070 (longest request)
ab测试 uwsgi遇到的问题的更多相关文章
- 【转载】AB测试结果分析
AB测试,200个请求,20个并发.这样的测试强度,CPU占了70-80%,w3p占用了70多M内存,本想多测几次,看看它的内存会不会涨上去,没 有测试机器没办法,开发机要干活.我估计CPU就有问题了 ...
- Apache 的ab测试
<!-- 博主所有文章仅是作为自己的笔记 如有不足 请见谅--> Apache的ab测试 和 ab测试 不是一个东西(百度 ab测试可以了解) 网站性能压力测试是服务器网站性能调优过程 ...
- ab测试出现error: connection reset by peer的解决方案
我们在使用一些开源程序之前,可能会使用ab工具在服务器或者本地进行一次性能评估,但是很多时候却总是会以失败告终,因为,服务器会拒绝你的ab工具发出的http请求, 出现 error: connecti ...
- 算法效果AB测试中的PV-UV不对称性
(转载请注明原创于潘多拉盒子) 算法效果的AB测试,是指在相同的应用场景下,对比不同算法的效果.通常的做法是,按照PV或UV随机分配流量到算法上,计算算法的CTR或转化率进行对比.为了表述简单,我们假 ...
- Apache ab 测试工具使用(一)
简述: 试用apache ab测试工具 下载点 http://httpd.apache.org/download.cgi 参考: http://jingyan.baidu.com/article/e3 ...
- 使用apache benchmark(ab) 测试报错汇总
1.socket: Too many open files (24) 解决方法: [root@zabbix ~]# ulimit -a core file size (blocks, -c) 0 da ...
- Apache ab测试工具使用方法(无参、get传参、post传参)
Ab测试工具是apache自带的测试工具,具有简单易上手的特性,下面我总结一下我的使用方法,首先去官方下载apache程序包,我下的最新版本apache2.4.23,下载地址http://httpd. ...
- 多臂机测试, AB测试
bandit 强盗,土匪:恶棍:敲诈者 ['bændɪt] 多臂机 multi-armed bandit MAB 简写. one-arm bandit tiger ji 是一种自动AB测试的方 ...
- 网易郑栋:数据采集与分析的那些事——从数据埋点到AB测试
本文由 网易云发布. 4月8日晚,DTalk邀请到了网易互联网分析产品.可视化 BI 产品的负责人—郑栋老师,进行了一次关于<网易郑栋:数据采集与分析的那些事第一弹: 数据篇>的主题分享 ...
随机推荐
- SQL函数学习(三):convert()函数
格式:CONVERT(data_type,expression[,style])说明:此样式一般在时间类型(datetime,smalldatetime)与字符串类型(nchar,nvarchar,c ...
- Yii2.0官方高级模板的目录结构分析
Yii 是什么 Yii 是一个高性能,基于组件的 PHP 框架,用于快速开发现代 Web 应用程序.名字 Yii (读作 易)在中文里有"极致简单与不断演变"两重含义,也可看作 Y ...
- Deep Learning(深度学习)网络资源
Deep Learning(深度学习) ufldl的2个教程(这个没得说,入门绝对的好教程,Ng的,逻辑清晰有练习):一 ufldl的2个教程(这个没得说,入门绝对的好教程,Ng的,逻辑清晰有练习): ...
- Android makefile 组织结构
下面是main.mk文件包含关系,本文档主要说明的就是这些文件里到底做了什么.(这个文件被根目录下的makefile文件包含) 一. main.mk BUILD_SYSTEM=build/co ...
- 《JavaScript高级程序设计》读书笔记 ---数据类型
ECMAScript 中有5 种简单数据类型(也称为基本数据类型):Undefined.Null.Boolean.Number.String和Object——复杂数据类型,Object 本质上是由一组 ...
- List循环与Map循环的总结
做了一下list和map的总结,没有什么技术含量,就全当复习了一下api. 测试环境是在junit4下,如果没有自己写一个main方法也是一样的. 首先是List的三种循环: @Test public ...
- 根据字符串获取对应类型(Type) 转
public static Type GetTypeByString(string type) { switch (type.ToLower()) ...
- Away 3d 框架
卷 工作资料 的文件夹 PATH 列表 卷序列号为 00000200 F8B8:EE5E E:. │ tree.txt │ tree1.txt │ ├─away3d │ │ .DS_Sto ...
- oracle的exp和imp命令的使用【转载】
oracle的exp和imp命令的使用 我们通常要对ORACLE的数据进行导入,导出,在没有expdb,impdb以前(10G以前),我们都是使用exp 导出,imp命令来实现导入. 打开 ...
- 二分三角形的时候尤其需要注意!!! HDU 5115 二分+模拟
题目大意:http://blog.csdn.net/snowy_smile/article/details/49535301 思路:分类讨论,分别在[1,2].(2,3).[3,4).[4,1]相遇, ...