版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
web页面与javawebsocket接口的
压力测试
对于网站开发,压力测试是少不了的。压力测试可以对网络,服务器,
系统架构的优化程度进行检验。以便提前知道网站的负载能力,并未
优化提供依据飞
对于网站的压力测试,基本离不开下面两点的测试:W㊀b页面访问的
压力测试和java接口的压力测试(我们接口是通过websocket实
现)。
web页面访问压力测试工具可以使用apache自带的ab命令进行检
测;javawebsocket接口的压力测试可以使用
Jmeter+websocket插件进行检测。
ab安装与使用
一、下载软件
下载地址:
二、进入软件路径
把下载的文件解压到后,用cmd指令进入〃文件夹路径
/Apache24/bin,z
三、获取ab指令参数列表
执行''abhelpz,
Optionsare:
-nrequestsNumberofrequeststoperform
-cconcurrencyNumberofmultiplerequeststo
makeatatime
-ttimelimitSecondstomax.tospendon
benchmarking
Thisimplies-n50000
-stimeoutSecondstomax.waitforeach
response
Defaultisseconds
-bwindowsizeSizeofTCPsend/receivebuffer
inbytes
-BaddressAddresstobindtowhenmaking
outgoingconnections
-ppostfileFilecontainingdatatoPOST.
Rememberalsotoset-T
-uputfileFilecontainingdatatoPUT.
Rememberalsotoset-T
-Tcontent-typeContent-typeheadertousefor
POST/PUTdata,eg.
'app1ication/x-www-form-urlencoded,
Defaultis1text/plain,
-vverbosityHowmuchtroubleshootinginfo
toprint
-wPrintoutresultsinHTML
tables
-iUseHEADinsteadofGET
-xattributesStringtoinsertastable
attributes
-yattributesStringtoinsertastr
attributes
-zattributesStringtoinsertastdorth
attributes
-CattributeAddcookie,eg.1Apache=12341.
(repeatable)
-HattributeAddArbitraryheaderline,eg.
'Accept-Encoding:gzip,
Insertedafterallnormal
headerlines.(repeatable)
-AattributeAddBasicWWWAuthentication,
theattributes
areacolonseparatedusername
andpassword.
-PattributeAddBasicProxyAuthentication,
theattributes
areacolonseparatedusername
andpassword.
-Xproxy:portProxyserverandportnumberto
use
-VPrintversionnumberandexit
-kUseHTTPKeepAlivefeature
-dDonotshowpercentilesserved
table.
-SDonotshowconfidence
estimatorsandwarnings.
-qDonotshowprogresswhendoing
morethanI50requests
-1Acceptvariabledocument
length(usethisfordynamicpages)
-gfilenameOutputcollecteddatato
gnuplotformatfile.
-efilenameOutputCSVfilewith
percentagesserved
-rDonTtexitonsocketreceive
errors.
-mmethodMethodname
-hDisplayusageinformation
(thismessage)
质、进行web压力测试
执行、'ab-n1000-c
100〃
五、报表结果
ServerSottware:Apache/2.4./Server
Hostname:ServerPort:
80
DocumentPath:/index.htmlDocument
Length:16300bytes
ConcurrencyLevel:lOOTimetakenfortests:
26.93:secondsCompleterequests:lOOCFailed
requests:CTotaltransferred:
165,';3000bytes
HTMLtransferred:1630000CbytesRequestsper
second:37.13[#/sec](mean)Timeperrequest:
93.147[ms](mean)Timeperrequest:26.931
[ms](mean,acrossallconcurrentrequests)Transfer
rate:60C.95[Kbytes/sec]received
ConnectionTimes(ms)
minmean[+/-sd]median
maxConnect:9279.1
SIProcessing:二;:2532466.3
2740Waiting:271325769.3
2649Total:802559466.126872776
Percentageoftherequestsservedwithinacertain
time(ms)
50%2687
66%2704
75%2714
80%2718
90%2730
95%2739
98%2749
99%2754
100%(longestrequest)
Jmeter安装与使用
一、下载
下载地址:
二、安装
解压文件夹,然后进入''apache-jmeter-2.13/bin/,z
双击''jmeter.bat〃启动软件
三、安装websokcet插件
Websocket插件下载:
把jar包复制到''jme七er安装路径/lib/ext/〃
关闭jmeter再启动
!1!使用
a)添
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年人力资源租赁数据安全协议
- 2026年电商投资数据安全协议
- 2026年重庆市万州区天城妇幼保健院医护人员招聘笔试备考试题及答案详解
- 道路客运乘务员操作评估考核试卷含答案
- 2026年重庆机床厂职工医院医护人员招聘笔试备考题库及答案详解
- 2026年安徽省新华肿瘤医院医护人员招聘笔试模拟试题及答案详解
- 钟表设计师岗前质量检验考核试卷含答案
- 2025-2026学年语文教学杂志设计软件
- 缝纫工工作效率评优考核试卷含答案
- 井筒维修工岗位适应能力测试考核试卷含答案
- 燃气燃烧器知识介绍
- (一模)2025年合肥市2025届高三第一次教学质量检测 政治试卷 (含标准答案)
- 消除“艾梅乙”医疗歧视-从我做起
- 2024年重庆市中考地理试卷真题(含官方答案及解析)
- 08BJ9-1室外工程-围墙围栏
- 小升初试题-2023-2024学年语文六年级下册统编版
- (正式版)SHT 3075-2024 石油化工钢制压力容器材料选用规范
- 统编版五年级下册第八单元习作:漫画的启示 课件
- 5.过氧化值检测原始记录
- YY/T 1437-2023医疗器械GB/T 42062应用指南
- 过程装备与控制工程专业导论
评论
0/150
提交评论