Ejabberd用Tsung注册用户

时间:2017-01-06 06:21:40

标签: ejabberd tsung

我安装了tsung并在Centos上运行相同的操作。 尝试运行jabber_register.xml tsung -f file.xml start时未注册使用。问题究竟在哪里?

我在Ejabberd日志中看到Acceted connection,但没有注册用户。

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">

  <clients>
    <client host="localhost" use_controller_vm="true"></client>
  </clients>

  <!-- Server side setup -->
 <servers>
  <server host="127.0.0.1" port="5222" type="tcp"></server>
 </servers>

  <load>
   <arrivalphase phase="1" duration="1" unit="minute">
    <users maxnumber="100" interarrival="1" unit="second"></users>
   </arrivalphase>
   <user session="xmpp-connection" start_time="1" unit="second"></user>
  </load>

  <!-- JABBER parameters -->
  <!-- to synchronise users,  use a global acknoledgement -->
 <options>
  <option type="ts_jabber" name="global_number" value="100"></option>
  <option type="ts_jabber" name="userid_max" value="200000"></option>
  <option type="ts_jabber" name="domain" value="example.com"></option>
  <option type="ts_jabber" name="username" value="tsung_user"></option>
  <option type="ts_jabber" name="passwd" value="tsung_pwd"></option>
 </options>

  <sessions>
    <session probability="100" name="jabber-example" type="ts_jabber">
    <request> <jabber type="connect" ack="local"></jabber> </request>
    <thinktime value="2"></thinktime>
    <transaction name="authenticate">
        <request> <jabber type="auth_sasl" ack="local"></jabber> </request>
        <request> <jabber type="connect" ack="local"></jabber> </request>
        <request> <jabber type="auth_sasl_bind" ack="local" ></jabber></request>
        <request> <jabber type="auth_sasl_session" ack="local" ></jabber></request>
        <request> <jabber type="presence:initial" ack="no_ack"/> </request>
    </transaction>
   <thinktime value="30"></thinktime>
    <transaction name="online">
     <request> <jabber type="chat" ack="no_ack" size="4000" destination="online"/></request>
   </transaction>

     <transaction name="close">
        <request> <jabber type="close" ack="local"></jabber> </request>
    </transaction>
    </session>
</sessions>
</tsung>

以下是tsung.log

# stats: dump at 1483683039
stats: users 1 4
stats: {freemem,"tsung_controller@centos"} 1 1456.01953125 0.0 1456.5390625 1455.87109375 1456.1263020833333 3
stats: {load,"tsung_controller@centos"} 1 0.01171875 0.0 0.01953125 0.01171875 0.014322916666666666 3
stats: {cpu,"tsung_controller@centos"} 1 2.3069207622868606 0.0 2.4975024975024978 1.1518372449915872 1.9846496536436529 3
stats: session 7 2042.459681919643 0.5394376539819091 2049.197998046875 2041.028076171875 2041.9925944010417 27
stats: users_count 8 35
stats: finish_users_count 7 34
stats: request 40 1.45291748046875 0.21618170915409465 4.088134765625 0.952880859375 1.3667364921278626 131
stats: connect 40 0.643145751953125 0.29426544797099324 2.958984375 0.256103515625 0.6991087935353053 131
stats: page 8 1.55010986328125 0.21899365581343963 4.088134765625 0.952880859375 1.4904966001157407 27
stats: tr_authenticate 8 38.19097900390625 0.8066643325794721 39.382080078125 37.134033203125 37.7615966796875 26
stats: size_rcv 11846 50623
stats: size_sent 4760 20286
stats: connected 0 0
stats: error_connection_closed 24 102
stats: error_abort_max_send_retries 8 34

tsung_controller.log

=INFO REPORT==== 6-Jan-2017::06:11:01 ===
           ts_client:(5:<0.218.0>) connection close while sending message!

=INFO REPORT==== 6-Jan-2017::06:11:01 ===
           ts_client:(5:<0.218.0>) Server must have closed connection upon us, waiting 10 msec

=INFO REPORT==== 6-Jan-2017::06:11:01 ===
           ts_client:(5:<0.218.0>) connection close while sending message!

=INFO REPORT==== 6-Jan-2017::06:11:01 ===
           ts_client:(5:<0.218.0>) Server must have closed connection upon us, waiting 10 msec

=INFO REPORT==== 6-Jan-2017::06:11:01 ===
           ts_client:(5:<0.218.0>) connection close while sending message!

=INFO REPORT==== 6-Jan-2017::06:11:01 ===
           ts_client:(5:<0.218.0>) Server must have closed connection upon us, waiting 10 msec

=INFO REPORT==== 6-Jan-2017::06:11:01 ===
           ts_client:(3:<0.218.0>) EXIT Error: Unable to send data, max_retries reached; reason: {error,
                                                                                                  closed}

=INFO REPORT==== 6-Jan-2017::06:11:01 ===
           ts_client:(5:<0.218.0>) Pending transactions: [{tr_authenticate,
                                                           {1483,683061,
                                                            201737}}], compute transaction time

1 个答案:

答案 0 :(得分:1)

您正在运行聊天脚本,而且我认为脚本中使用的用户名和密码尚未注册。

请参考以下脚本进行注册,然后运行聊天脚本。

<tsung loglevel="notice" dumptraffic="false" version="1.0">
<clients>
<client host="localhost" use_controller_vm="true"> </client>
</clients>
<servers>
<server host="127.0.0.1" port="5222" type="tcp"/>
</servers>
<!--  register 200000 users in less than 15 minutes   -->
<load>
<arrivalphase phase="1" duration="15" unit="minute">
<users maxnumber="200000" interarrival="0.0025" unit="second"/>
</arrivalphase>
</load>
<options>
<option type="ts_jabber" name="global_number" value="5"/>
<option type="ts_jabber" name="userid_max" value="200000"/>
<option type="ts_jabber" name="domain" value="erlang-projects.org"/>
<option type="ts_jabber" name="username" value="tsung"/>
<option type="ts_jabber" name="passwd" value="tsung"/>
</options>
<sessions>
<session probability="100" name="jabber-example" type="ts_jabber">
<request>
<jabber type="connect" ack="local"/>
</request>
<request>
<match do="abort" when="match">error</match>
<jabber type="register" ack="local" id="new"/>
</request>
<request>
<jabber type="close" ack="local"/>
</request>
</session>
</sessions>
</tsung>

注意:您提到“ 尝试运行jabber_register.xml tsung -f file.xml start时未注册使用”。

我建议您先为较少的用户运行,然后再转向更多的用户。因为在运行繁重的负载时需要增加客户端计算机的内存。

如果您有任何疑问,请告诉我。