web页面与javawebsocket接口的压力测试_第1页
web页面与javawebsocket接口的压力测试_第2页
web页面与javawebsocket接口的压力测试_第3页
web页面与javawebsocket接口的压力测试_第4页
web页面与javawebsocket接口的压力测试_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论