您的位置:首页 > 其它

sipp 对asterisk 进行压力测试

2013-07-10 11:54 1146 查看
测试环境

asterisk192.168.106.170

版本astrisk1.8

sipp192.168.106.141

sipp版本3.3

安装依赖包
yuminstallmakegccgcc-c++ncursesncurses.x86_64ncurses-develncurses-devel.x86_64openssllibnetlibpcaplibpcap-devellibpcap.x86_64libpcap-devel.x86_64gslgsl-devel


asterisk配置

sip.conf

[general]
context=default
allowoverlap=no
allowguest=no
udpbindaddr=0.0.0.0
tcpenable=no
tcpbindaddr=0.0.0.0
srvlookup=yes
language=cn
callevents=yes
limitonpeers=no
jbenable=yes

[sipp]

host=192.168.106.141
type=friend

disallow=all
allow=g729
allow=g723
allow=ulaw
allow=alaw
context=sipp


extension.conf

[general]
static=yes
writeprotect=no
clearglobalvars=no

[globals]

[sipp]
exten=>7777,1,Answer
exten=>7777,2,SetMusicOnHold(default)
exten=>7777,3,WaitMusicOnHold(2000)
exten=>7777,4,Hangup


sipp客户端配置

uac-media.xml

<?xmlversion="1.0"encoding="ISO-8859-1"?>
<!DOCTYPEscenarioSYSTEM"sipp.dtd">

<!--Thisprogramisfreesoftware;youcanredistributeitand/or-->
<!--modifyitunderthetermsoftheGNUGeneralPublicLicenseas-->
<!--publishedbytheFreeSoftwareFoundation;eitherversion2ofthe-->
<!--License,or(atyouroption)anylaterversion.-->
<!---->
<!--Thisprogramisdistributedinthehopethatitwillbeuseful,-->
<!--butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof-->
<!--MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe-->
<!--GNUGeneralPublicLicenseformoredetails.-->
<!---->
<!--YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense-->
<!--alongwiththisprogram;ifnot,writetothe-->
<!--FreeSoftwareFoundation,Inc.,-->
<!--59TemplePlace,Suite330,Boston,MA02111-1307USA-->
<!---->
<!--Sipp'uac'scenariowithpcap(rtp)play-->
<!---->

<scenarioname="BasicSipstoneUAC">
<!--Inclientmode(sippplacingcalls),theCall-IDMUSTbe-->
<!--generatedbysipp.Todoso,use[call_id]keyword.-->
<sendretrans="500">
<![CDATA[

INVITEsip:[field1]@[remote_ip]:[remote_port]SIP/2.0
Via:SIP/2.0/[transport][local_ip]:[local_port];branch=[branch]
From:sipp<sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
To:sut<sip:[field1]@[remote_ip]:[remote_port]>
Call-ID:[call_id]
CSeq:1INVITE
Contact:sip:sipp@[local_ip]:[local_port]
Max-Forwards:70
Subject:PerformanceTest
Content-Type:application/sdp
Content-Length:[len]

v=0
o=user1536557652353687637INIP[local_ip_type][local_ip]
s=-
c=INIP[local_ip_type][local_ip]
t=00
m=audio[media_port]RTP/AVP0
a=rtpmap:18G729

]]>
</send>

<recvresponse="100"
optional="true">
</recv>

<!--Byaddingrrs="true"(RecordRouteSets),theroutesets-->
<!--aresavedandusedforfollowingmessagessent.Usefultotest-->
<!--againststatefulSIPproxies/B2BUAs.-->
<recvresponse="200"rtd="true">
</recv>

<!--Packetlostcanbesimulatedinanysend/recvmessageby-->
<!--byaddingthe'lost="10"'.Valuecanbe[1-100]percent.-->
<send>
<![CDATA[

ACKsip:[field1]@[remote_ip]:[remote_port]SIP/2.0
Via:SIP/2.0/[transport][local_ip]:[local_port];branch=[branch]
From:sipp<sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
To:sut<sip:[field1]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID:[call_id]
CSeq:1ACK
Contact:sip:sipp@[local_ip]:[local_port]
Max-Forwards:70
Subject:PerformanceTest
Content-Length:0
]]>
</send>

<!--Playapre-recordedPCAPfile(RTPstream)-->
<nop>
<action>
<execplay_pcap_audio="pcap/g711a.pcap"/>
</action>
</nop>

<!--Pause800seconds,whichisapproximatelythedurationofthe-->
<!--PCAPfile-->
<pausemilliseconds="800000"/>

<!--Thisdelaycanbecustomizedbythe-dcommand-lineoption-->
<!--orbyaddinga'milliseconds="value"optionhere-->
<pause/>

<!--The'crlf'optioninsertsablanklineinthestatisticsreport.-->
<sendretrans="500">
<![CDATA[

BYEsip:[field1]@[remote_ip]:[remote_port]SIP/2.0
Via:SIP/2.0/[transport][local_ip]:[local_port];branch=[branch]
From:sipp<sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
To:sut<sip:[field1]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID:[call_id]
CSeq:2BYE
Contact:sip:sipp@[local_ip]:[local_port]
Max-Forwards:70
Subject:PerformanceTest
Content-Length:0
]]>
</send>

<recvresponse="200"crlf="true">
</recv>

<!--definitionoftheresponsetimerepartitiontable(unitisms)-->
<ResponseTimeRepartitionvalue="10,20,30,40,50,100,150,200"/>

<!--definitionofthecalllengthrepartitiontable(unitisms)-->
<CallLengthRepartitionvalue="10,50,100,500,1000,5000,10000"/>

</scenario>


44.csv

SEQUENTIAL
4444;7777;[authenticationusername=4444password=8888]


之后执行命令

./sipp-sfuac-media.xml-inf44.csv-p5060-i192.168.106.141-m100000192.168.106.170-l2000


显示

LastError:AbortingcallonUDPretransmissiontimeoutforCall-ID'281...
------------------------------ScenarioScreen--------[1-9]:ChangeScreen--
Call-rate(length)PortTotal-timeTotal-callsRemote-host
10.0(0ms)/1.000s5060313.57s3135192.168.106.170:5060(UDP)

9newcallsduring0.952speriod0msschedulerresolution
1322calls(limit2000)Peakwas1332calls,after300s
1Running,1659Paused,62Wokenup
1702deadcallmsg(discarded)1444out-of-callmsg(discarded)
3opensockets

MessagesRetransTimeoutUnexpected-Msg
INVITE---------->3135108231680
100<----------1140000
200<----------E-RTD11140180300
ACK---------->11401803
Pause[13:20]1140133
Pause[0ms]00
BYE---------->000
200<----------0000

------------------------------TestTerminated--------------------------------


asterisk服务器显示

SIP/sipp-00000cb77777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000a187777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000cb47777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000a3e7777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000cb57777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000a3d7777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000ab47777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000cb27777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000ab57777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000cb37777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000a3f7777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000ab67777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000cb07777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000a3a7777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000ab77777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000cb17777@sipp:3UpWaitMusicOnHold(2000)
SIP/sipp-00000ab07777@sipp:3UpWaitMusicOnHold(2000)
1000activechannels
1000activecalls
3783callsprocessed
[root@testasterisk]#asterisk-rx"coreshowchannels"

-----------------------------------

Can'tcreatethreadtosendRTPpackets,翻译过来就是“无法创建线程发送RTP数据包”

大概知道是需要设置ulimit,但设置好像没有生效。在龙舟兄弟的指导与提醒下,索性直接ulimit-sunlimited,设置为不限制了。

如此之后,rtp就不受限制了。



xml实例文件

https://github.com/saghul/sipp-scenarios
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: