sipp压测集群freeswitch第7篇集群会议

文章介绍了如何使用SIPp进行集群音频会议的压测,包括配置XML脚本、处理路由和挂断机制。作者提到SIPp对集群压测的支持有限,以及他们在实践中遇到的问题和初步推断。
摘要由CSDN通过智能技术生成

SIPp怎么压测集群,社区的文章相对较少,比较sip的知识细分相对比较垂直,最近刚好在做这个,其实难度不大,关键是要了解sip有个松散路由和绝对路由,是要根据实际sip交互来动态处理的

流程SIPp=呼叫=>代理服务器=>转发=>到具体服务器=>自动接通播放wav

confClusterCallAudio脚本xml

脚本大概意思是:发起成功后执行5分钟后自己挂断

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="UAC with media">
	<!-- 集群音频会议 -->
	<send retrans="500">
    <![CDATA[

      INVITE sip:[field0]@[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=[pid]SIPpTag09[call_number]
      To: [field0] <sip:[field0]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 1 INVITE
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Type: application/sdp
      Content-Length: [len]

      v=0
      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
      s=-
      c=IN IP[local_ip_type] [local_ip]
      t=0 0
      m=audio [media_port] RTP/AVP 8 101
      a=rtpmap:8 PCMA/8000
      a=rtpmap:101 telephone-event/8000
      a=fmtp:101 0-11,16

    ]]>
  </send>

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

  <recv response="180" optional="true">
  </recv>

  <recv response="183" optional="true">
  </recv>
  
  <recv response="200" rtd="true" crlf="true">
    <action>
      <ereg regexp="([0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]{1,5}" search_in="hdr" header="Contact:" check_it="true" assign_to="8" />  
      <ereg regexp="(.*)" search_in="hdr" header="Record-Route:" check_it="true" assign_to="9" />  
    </action>
  </recv>

  <send>
    <![CDATA[

      ACK sip:[field0]@[$8] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag09[call_number]
      To: [field0] <sip:[field0]@[remote_ip]:[remote_port]>[peer_tag_param]
      Call-ID: [call_id]
      CSeq: 1 ACK
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Length: 0
      Route: [$9]
    ]]>
  </send>
	<!--  Freeswitch设置播放视频,SIPp回显  --> 

  <nop>
    <action>
      <exec play_pcap_audio="/root/sip_test/pcap/g711a.pcap"/>
    </action>
  </nop>

	
  <pause milliseconds="300000"/>

  <send retrans="500">
    <![CDATA[

      BYE sip:[field0]@[$8] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag09[call_number]
      To: [field0] <sip:[field0]@[remote_ip]:[remote_port]>[peer_tag_param]
      Call-ID: [call_id]
      CSeq: 2 BYE
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Length: 0
      Route: [$9]
    ]]>
  </send>

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

  <!-- definition of the response time repartition table (unit is ms)   -->
  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>

  <!-- definition of the call length repartition table (unit is ms)     -->
  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>

</scenario>
会议conf.csv
// 1个会议;  文件名:conf1.csv
SEQUENTIAL
conf1;
// 5个会议;   文件名:conf5.csv
SEQUENTIAL
conf1;
conf2;
conf3;
conf4;
conf5;
指令介绍
/*
* -t tn:  每个呼叫是一个tcp(建议开启,这样模拟起来相对真实)
* -rtp_echo:  启用 RTP 回显
* -r 20 -rp 1000: 每秒注册20个账号
* -m 5000: 注册到达5000后停止脚本
* -trace_msg: 开启后打印所有过程中的消息(如果有错误建议开启,只能看到交互的消息,无法看到rtp传输)
* -trace_screen: 结束后吧结果打印到屏幕上
* -trace_err: 开启后打印错误消息
* remote_ip: 被压测Fs地址
* remote_port: 被压测Fs端口
*/
sipp [remote_ip]:[remote_port] -inf [csv] -sf [xml] -m [Number] -r [Number] -rp [Number] -t tn -rtp_echo  -trace_screen -trace_err
使用
// 压测一个会议: 使用一个会议的csv 每秒20个呼叫键入会议; 呼叫执行40次;
sipp 102.95.28:5060 -inf conf1.csv -sf confClusterCallAudio.xml -m 40 -r 20 -rp 1000 -t tn -rtp_echo  -trace_screen -trace_err
// 压测5个会议: 使用5个会议csv 每秒20个呼叫; 呼叫执行40次; 最终1个会议20个人;
sipp 102.95.28:5060 -inf conf5.csv -sf confClusterCallAudio.xml -m 40 -r 20 -rp 1000 -t tn -rtp_echo  -trace_screen -trace_err
注意

我们的集群方案在压测的时候,结果不是很理想;
初步推断是SIPp压测集群会议模式支持不友好,官方也没有提供压测集群的例子,但是脚本这么写应该是没问题的;

我们当时遇到的问题是:SIPp所有回显都是到一个固定的端口,每次结束的时候,会有个别会议挂不断,数量多的时候SIPp脚本执行后,SIPp自己崩了;

  • 6
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值