一个开源的多协议分布式负载测试工具,使用 erlang 语言开发的。
它能用来压力测试 HTTP, WebDAV, SOAP, PostgreSQL, MySQL, LDAP 和 Jabber/XMPP 的服务器。它可以分布在多个客户机,并能够模拟成千上万的虚拟用户数并发。 来自百度。。
我是在本机安装的虚拟机 CentOS7.1 系统,ejabberd 服务也在此虚拟机上安装好了,ejabberd 服务已启动,测试服务没有问题
然后安装 tsung1.5.1 等等软件之后,执行了一个注册用户的测试脚本,脚本设置的场景是注册 200 用户,运行结果只成功注册了一个用户。求大神帮忙看看问题在哪,脚本是按照官方给的例子修改的。
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/tsung/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" dumptraffic="false" version="1.0">
<clients>
<client host="localhost" use_controller_vm="true" maxusers="600" >
</client>
</clients>
<servers>
<server host='localhost' port='5222' type='tcp'/>
</servers>
<load>
<arrivalphase phase="1" duration="15" unit="minute">
<users maxnumber="200" interarrival="0.025" unit="second"></users>
</arrivalphase>
</load>
<options>
<option type="ts_jabber" name="global_number" value="200"></option>
<option type="ts_jabber" name="userid_max" value="200"></option>
<option type="ts_jabber" name="domain" value="localhost"></option>
<option type="ts_jabber" name="username" value="tsung"></option>
<option type="ts_jabber" name="passwd" value="tsung"></option>
</options>
<sessions>
<session probability="100" name="jabber-example" type="ts_jabber">
<request>
<jabber type="connect" ack="local"></jabber>
</request>
<request>
<match do="abort" when="match">error</match>
<jabber type="register" ack="local" id="new"></jabber>
</request>
<request>
<jabber type="close" ack="local"></jabber>
</request>
</session>
</sessions>
</tsung>
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_config_server:(5:<0.51.0>) Config server started, logdir is "/root/.tsung/log/20150421-1109"
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_mon:(5:<0.50.0>) starting monitor, global
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_config:(5:<0.51.0>) Reading config file: jabber_register.xml
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_user_server:(5:<0.66.0>) Reset offline and online lists (maxid=200)
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_config:(5:<0.51.0>) Session name for id 1 is "jabber-example"
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_user_server:(5:<0.66.0>) Reset offline and online lists (maxid=200)
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_config_server:(4:<0.51.0>) SYSINFO:Tsung version: 1.5.1
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_config_server:(4:<0.51.0>) SYSINFO:Erlang version: Erlang/OTP 17 [erts-6.4] [source] [64-bit] [async-threads:16] [hipe] [kernel-poll:true]
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_config_server:(4:<0.51.0>) SYSINFO:System architecture x86_64-unknown-linux-gnu
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_config_server:(4:<0.51.0>) SYSINFO:Current path: /usr/local/tsung/lib/erlang/lib/tsung-1.5.1/ebin/tsung.beam
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_os_mon:(5:<0.48.0>) os_mon disabled
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_mon:(5:<0.52.0>) Activate clients with text backend
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_mon:(5:<0.52.0>) Starting tsung clients on hosts: [localhost]
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_config_server:(5:<0.51.0>) Start a launcher on the controller beam localhost
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_launcher_static:(5:<0.83.0>) Launch msg receive ("localhost")
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_launcher:(5:<0.84.0>) Launch msg receive ("localhost")
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_config_server:(5:<0.51.0>) All remote beams started, syncing
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_config_server:(5:<0.51.0>) Undefined ports_range config
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_config_server:(5:<0.51.0>) New arrival phase 1 for client "localhost" (last ? true): will start 200 users
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_launcher:(5:<0.84.0>) Expected duration of first phase: 900.0 sec (200 users)
=INFO REPORT==== 21-Apr-2015::11:09:06 ===
ts_launcher:(5:<0.84.0>) Activate launcher (200 users) in 983 msec
=INFO REPORT==== 21-Apr-2015::11:09:13 ===
ts_launcher:(5:<0.84.0>) This was the last phase, wait for connected users to finish their session
=INFO REPORT==== 21-Apr-2015::11:09:18 ===
ts_launcher_mgr:(5:<0.79.0>) No more active users tsung_controller@localhost "12772"
=INFO REPORT==== 21-Apr-2015::11:09:18 ===
ts_mon:(5:<0.52.0>) stopping monitor (normal)
# stats: dump at 1429585756
stats: users 0 4
stats: session 200 9.99697875976563 11.816601055145759 134.97998046875 2.526123046875 0 0
stats: users_count 200 200
stats: finish_users_count 200 200
stats: request 401 3.4125093759741274 6.419080058220296 88.15087890625 0.197998046875 0 0
stats: page 1 82.1630859375 0.0 82.1630859375 82.1630859375 0 0
stats: connect 200 1.3886572265624997 3.442436301013272 46.936767578125 0.287109375 0 0
stats: match_stop 199 199
stats: nomatch 1 1
stats: size_rcv 197363 197363
stats: match 199 199
stats: size_sent 59892 59892
stats: connected 0 0
# stats: dump at 1429585758
stats: users 0 4
stats: session 0 0 0 134.97998046875 2.526123046875 9.99697875976563 200
stats: users_count 0 200
stats: finish_users_count 0 200
stats: request 0 0 0 88.15087890625 0.197998046875 3.4125093759741274 401
stats: page 0 0 0 82.1630859375 82.1630859375 82.1630859375 1
stats: connect 0 0 0 46.936767578125 0.287109375 1.3886572265624997 200
stats: match_stop 0 199
stats: nomatch 0 1
stats: size_rcv 0 197363
stats: match 0 199
stats: size_sent 0 59892
stats: connected 0 0
EndMonitor:{1429,585758,181923}