其他测试框架 有同学用 tsung 对 ejabberd 服务器做压力测试吗

向阳 · 2015年04月21日 · 最后由 测试小书童 回复于 2016年05月12日 · 2863 次阅读

tsung

一个开源的多协议分布式负载测试工具,使用 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>

tsung_controller@localhost.log

=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)

tsung.log

# 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}
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 8 条回复 时间 点赞

比 jmeter 好在哪?
我之前试验过 gating. 但是功能还不太完善. 所以还是坚定的回到了 jmeter.
不过 gating 本身的确做的挺好的.

@seveniruby 这个 tsung 具体比 jmeter 好在哪,确实不知道,但是网上看测 jabber 的用这个的多,还在研究中,

💪 涨姿势了

我也遇到这个问题了,环境用的是 centos7,tsung1.6.0,ejabberd-15.06-linux-x86_64-installer.run,请问楼主最后怎么解决的?

@h264g729 时间太久了 我也忘了怎么处理的了

默认限制 5 分钟一个号,配制改成:
registration_timeout: infinity

是否支持 windows 安装,我最近也无意发现这工具:

  • 开源的多协议分布式负载测试工具,使用 erlang 语言开发的。
  • 它可以分布在多个客户机,并能够模拟成千上万的虚拟用户数并发。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册