Link: http://www.blogjava.net/amigoxie/archive/2009/09/11/294717.html
1. SIPp概述
1.1 介绍
SIPp是一个测试SIP协议性能的工具软件。这是一个GPL的开放源码软件。
它包含了一些基本的SipStone用户代理工作流程(UAC和UAS),并可使用INVITE和B YE建立和释放多个呼叫。它也可以读XML的场景文件,即描述任何性能测试的配置文件。它能动态显示测试运行的统计数据(呼叫速率、信号来回的延迟,以及 消息统计)。周期性地把CSV统计数据转储,在多个套接字上的TCP和UDP,利用重新传输管理的多路复用。在场景定义文件中可以使用正规表达式,动态调 整呼叫速率。
SIPp可以用来测试许多真实的SIP设备,如SIP代理,B2BUAs,SIP媒体服务器,SIP/x网关,SIP PBX,等等,它也可以模仿上千个SIP代理呼叫你的SIP系统。
关于SIPp从google上搜索到很多,可是关于SIPp的中文说明资料较少,或者很多都是不齐全的安装使用说明。
SIPp的网址:http://sipp.sourceforge.net/
1.2 用途
SIPp一般来进行AS的压力测试,图示如下:
UAC(发起端,主叫)--------------------AS---------------------UAS(接收端,被叫)
其中UAC和UAS都有SIPp来担任。因此可以由它来控制每秒有多少个caps,也可由它来控制一个呼叫持续多长时间等。
2. 安装
2.1 Windows版安装
很简单,省略。
3. SIPp的使用
3.1 运行SIPp
选择“程序”->”Sipp_3.1”->“Start sipp”,运行界面如下所示:
![](http://img.e-com-net.com/image/info8/b12be10ed5ec44e5bfbe41c692286b09.jpg)
在命令行运行:sipp,出现帮助信息,如下所示:
the scenarios.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
First line of this file say whether the data is to be
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
read in sequence (SEQUENTIAL), random (RANDOM), or user
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
(USER) order.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Each line corresponds to one call and has one or more
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
';' delimited data fields. Those fields can be referred
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
as [field0], [field1],
in the xml scenario file.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Several CSV files can be used simultaneously (syntax:
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-inf f1.csv -inf f2.csv
)
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-infindex : file field
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Create an index of file using field. For example -inf
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
users.csv -infindex users.csv 0 creates an index on the
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
first key.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-ip_field : Set which field from the injection file contains the IP
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
address from which the client will send its messages.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
If this option is omitted and the '-t ui' option is
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
present, then field 0 is assumed.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Use this option together with '-t ui'
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-l : Set the maximum number of simultaneous calls. Once this
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
limit is reached, traffic is decreased until the number
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
of open calls goes down. Default:
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
(3 * call_duration (s) * rate).
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-lost : Set the number of packets to lose by default (scenario
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
specifications override this value).
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-m : Stop the test and exit when 'calls' calls are processed
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-mi : Set the local media IP address (default: local primary
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
host IP address)
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-master : 3pcc extended mode: indicates the master number
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-max_recv_loops : Set the maximum number of messages received read per
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
cycle. Increase this value for high traffic level. The
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
default value is 1000.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-max_sched_loops : Set the maximum number of calsl run per event loop.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Increase this value for high traffic level. The default
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
value is 1000.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-max_reconnect : Set the the maximum number of reconnection.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-max_retrans : Maximum number of UDP retransmissions before call ends on
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
timeout. Default is 5 for INVITE transactions and 7 for
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
others.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-max_invite_retrans: Maximum number of UDP retransmissions for invite
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
transactions before call ends on timeout.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-max_non_invite_retrans: Maximum number of UDP retransmissions for non-invite
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
transactions before call ends on timeout.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-max_log_size : What is the limit for error and message log file sizes.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-max_socket : Set the max number of sockets to open simultaneously.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
This option is significant if you use one socket per
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
call. Once this limit is reached, traffic is distributed
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
over the sockets already opened. Default value is 50000
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-mb : Set the RTP echo buffer size (default: 2048).
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-mp : Set the local RTP echo port number. Default is 6000.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-nd : No Default. Disable all default behavior of SIPp which
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
are the following:
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- On UDP retransmission timeout, abort the call by
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
sending a BYE or a CANCEL
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- On receive timeout with no ontimeout attribute, abort
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
the call by sending a BYE or a CANCEL
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- On unexpected BYE send a 200 OK and close the call
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- On unexpected CANCEL send a 200 OK and close the call
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- On unexpected PING send a 200 OK and continue the call
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- On any other unexpected message, abort the call by
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
sending a BYE or a CANCEL
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-nr : Disable retransmission in UDP mode.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-nostdin : Disable stdin.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-p : Set the local port number. Default is a random free port
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
chosen by the system.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-pause_msg_ign : Ignore the messages received during a pause defined in
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
the scenario
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-periodic_rtd : Reset response time partition counters each logging
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
interval.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-r : Set the call rate (in calls per seconds). This value can
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
bechanged during test by pressing '+','_','*' or '/'.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Default is 10.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
pressing '+' key to increase call rate by 1 *
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
rate_scale,
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
pressing '-' key to decrease call rate by 1 *
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
rate_scale,
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
pressing '*' key to increase call rate by 10 *
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
rate_scale,
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
pressing '/' key to decrease call rate by 10 *
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
rate_scale.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
If the -rp option is used, the call rate is calculated
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
with the period in ms given by the user.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-rp : Specify the rate period for the call rate. Default is 1
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
second and default unit is milliseconds. This allows
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
you to have n calls every m milliseconds (by using -r n
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-rp m).
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Example: -r 7 -rp 2000 ==> 7 calls every 2 seconds.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-r 10 -rp 5s => 10 calls every 5 seconds.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-rate_scale : Control the units for the '+', '-', '*', and '/' keys.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-rate_increase : Specify the rate increase every -fd units (default is
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
seconds). This allows you to increase the load for each
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
independent logging period.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Example: -rate_increase 10 -fd 10s
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
==> increase calls by 10 every 10 seconds.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-rate_max : If -rate_increase is set, then quit after the rate
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
reaches this value.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Example: -rate_increase 10 -rate_max 100
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
==> increase calls by 10 until 100 cps is hit.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-no_rate_quit : If -rate_increase is set, do not quit after the rate
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
reaches -rate_max.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-recv_timeout : Global receive timeout. Default unit is milliseconds. If
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
the expected message is not received, the call times out
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
and is aborted.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-send_timeout : Global send timeout. Default unit is milliseconds. If a
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
message is not sent (due to congestion), the call times
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
out and is aborted.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-reconnect_close : Should calls be closed on reconnect?
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-reconnect_sleep : How long (in milliseconds) to sleep between the close and
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
reconnect?
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-ringbuffer_files: How many error/message files should be kept after
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
rotation?
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-ringbuffer_size : How large should error/message files be before they get
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
rotated?
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-rsa : Set the remote sending address to host:port for sending
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
the messages.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-rtp_echo : Enable RTP echo. RTP/UDP packets received on port defined
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
by -mp are echoed to their sender.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
RTP/UDP packets coming on this port + 2 are also echoed
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
to their sender (used for sound and video echo).
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-rtt_freq : freq is mandatory. Dump response times every freq calls
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
in the log file defined by -trace_rtt. Default value is
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
200.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-s : Set the username part of the resquest URI. Default is
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
'service'.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-sd : Dumps a default scenario (embeded in the sipp executable)
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-sf : Loads an alternate xml scenario file. To learn more
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
about XML scenario syntax, use the -sd option to dump
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
embedded scenarios. They contain all the necessary help.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-oocsf : Load out-of-call scenario.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-oocsn : Load out-of-call scenario.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-skip_rlimit : Do not perform rlimit tuning of file descriptor limits.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Default: false.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-slave : 3pcc extended mode: indicates the slave number
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-slave_cfg : 3pcc extended mode: indicates the file where the master
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
and slave addresses are stored
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-sn : Use a default scenario (embedded in the sipp executable).
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
If this option is omitted, the Standard SipStone UAC
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
scenario is loaded.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Available values in this version:
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- 'uac' : Standard SipStone UAC (default).
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- 'uas' : Simple UAS responder.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- 'regexp' : Standard SipStone UAC - with regexp and
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
variables.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- 'branchc' : Branching and conditional branching in
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
scenarios - client.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- 'branchs' : Branching and conditional branching in
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
scenarios - server.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
Default 3pcc scenarios (see -3pcc option):
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- '3pcc-C-A' : Controller A side (must be started after
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
all other 3pcc scenarios)
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- '3pcc-C-B' : Controller B side.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- '3pcc-A' : A side.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- '3pcc-B' : B side.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-stat_delimiter : Set the delimiter for the statistics file
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-stf : Set the file name to use to dump statistics
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
-t : Set the transport mode:
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- u1: UDP with one socket (default),
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- un: UDP with one socket per call,
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- ui: UDP with one socket per IP address The IP
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
addresses must be defined in the injection file.
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- t1: TCP with one socket,
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- tn: TCP with one socket per call,
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- l1: TLS with one socket,
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- ln: TLS with one socket per call,
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- c1: u1 + compression (only if compression plugin
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
loaded),
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
- cn: un + compression (only if compression plugin
![](http://img.e-com-net.com/image/info8/03cce58157ec4e298ef2df7e7627d2b5.gif)
loaded). This plugin is not provided with sipp.
3.2 使用SIPp进行压力测试
3.2.1启动服务端
首先查知本机的IP,例如笔者本机的IP为192.168.2.45。在SIPp的运行窗口运行:
sipp -sn uas -i 192.168.2.45 -p 5060
出现的命令窗口的内容类似如下:
![](http://img.e-com-net.com/image/info8/73e6977449584a299e3e724799ae2a53.jpg)
3.2.2启动和运行客户端
再开启一个SIPp界面。
启动客户端使用:sipp -sn uac….,使用如下:
sipp -sn uac -m 1 -i 192.168.2.45 -p 6060 -s 01012345678 192.168.2.154
启动后命令窗口如下所示:
![](http://img.e-com-net.com/image/info8/56765e786168437a9aa86945c31fecae.jpg)
其中:
-m:该参数表示每秒的caps数,若没写该参数,默认为每秒10个caps;
-i:这个用于指定本机的ip,若本机只有一个ip,可以不指定,若有多个IP,需要指定该参数;
-p:指定本机的端口,可以不指定;
-s:该参数用于指定要呼叫的电话号码;
192.168.1.154为AS的IP地址,没有指定端口时,默认指向的端口为5060。
注意:因为UAC和UAS都在笔者机器,IP为:192.168.2.45,因此AS端还需要对应配置,将落地等的IP地址等都指向该IP。对于我们的环境来说,需要配置SCF的config.as.ACD文件,修改成:
![](http://img.e-com-net.com/image/info8/f87d5b93129b4013854dbcc0ceae9084.jpg)
笔者修改了ss1的IP为:192.168.2.45.
在使用uac前,可使用SIP软终端来测试下是不是呼叫后落地是不是落在本机。
3.2.3查看运行结果
在运行:
sipp -sn uac -i 192.168.2.45 -p 6060 -s 01012345678 192.168.2.154
后(该句为10caps),可查看UAS和UAC的界面,服务端的界面类似如下所示:
![](http://img.e-com-net.com/image/info8/23fd0fcf0982458d81dd5a9611ac7e37.jpg)
UAC端的界面类似如下所示:
![](http://img.e-com-net.com/image/info8/1bc3a3d4c2fc43f88a6fd0a4d3d6080e.jpg)
因为笔者的AS没有发183的流程,所以它的次数是为0的,后续章节还会说到如果不是SIPp的参考流程时该怎么做。
3.2.4查看AS所在的Linux机器的性能情况
1)inmon
公司的SCF提供inmon来查看自动机挂接等的情况,如下所示:
![](http://img.e-com-net.com/image/info8/122632925013451d863b78d862c8dbb0.jpg)
其中FSMS表示当前挂着的自动机数,是需要关注的项。
2)vmstat
vmstat 命令报告关于内核线程、虚拟内存、磁盘、陷阱和 CPU 活动的统计信息。由 vmstat 命令生成的报告可以用于平衡系统负载活动。系统范围内的这些统计信息(所有的处理器中)都计算出以百分比表示的平均值,或者计算其总和。
例如笔者使用:
vmstat 3
表示每隔3s显示内核线程、虚拟内存、磁盘、陷阱和 CPU 活动的统计信息。界面如下所示:
![](http://img.e-com-net.com/image/info8/f78fdf6a15fa4075b36d720312c4c183.jpg)
重点要关注的项是io和cpu等信息。
3)top
top命令提供了实时的对系统处理器的状态监视。它将显示系统中CPU最“敏感”的任务列表。
运行top命令后,AS所在Linux机器的显示效果如下:
![](http://img.e-com-net.com/image/info8/6c128446107f4d678910b6a22750bbfc.jpg)
因为应用主要为cc和mysql,所以要重点关注这两者是否稳定。
主要关注的项是VIRT和RES,如果这两者一直增加,那很可能程序或其它地方存在内存泄露。
3.2.5其它
在UAC端运行的过程中:
1) 按“+”键表示在当前caps的基础中加1;
2) 按“-”键表示在当前caps的基础中减1;
3) 按“*”键表示在当前caps的基础中+运行起点的caps,例如10caps,按“*”后,变成20,再按“*”变成30.