tsung_snippets.md

ejabberd 2M benchmark

The exact tuning of the scenario is highly platform dependant. For example, we used 30 IP addresses to reach the server.

That’s why we only published notes and snippets relevant for general benchmarks.

Tsung configuration

Tsung is configured to inject 600 users/second during the bench:

<arrivalphase phase="1" duration="70000" unit="second">
   <users arrivalrate="600" unit="second"/>
</arrivalphase>

Each session load roster, set presence, and then remains “idle”
sending whitespace pings each minute to the server (and receiving
presence from contacts).

Tsung by default starts session using consecutive username (tsung1,
tsung2, tsung3, etc). We choose to read usernames from a randomized
file containing them,to make contacts get online/offline spread over
the lifetime of the test (our method to generate rosters did tend to
make consecutive usernames contacts):

 <session probability="100" name="xmpp-connection" type="ts_jabber"
bidi="true" persistent="false">

   <setdynvars sourcetype="file" fileid="userdb" delimiter=";" order="iter">
         <var name="userid"/>
   </setdynvars>

   <transaction name="initial_stream">
        <request subst="true">
           <jabber type="connect" ack="local">
                 <xmpp_authenticate username="tsung%%_userid%%"
passwd="tsung%%_userid%%"/>
          </jabber>
         </request>
   </transaction>

   <thinktime value="2"/>

   <transaction name="authenticate">
       <request> <jabber type="auth_sasl" ack="local"/> </request>
       <request> <jabber type="connect" ack="local"/> </request>
       <request> <jabber type="auth_sasl_bind" ack="local"/> </request>
       <request> <jabber type="auth_sasl_session" ack="local"/> </request>
   </transaction>


    <transaction name="roster_get">
       <request>  <jabber type="iq:roster:get" ack="local"/> </request>
   </transaction>


   <request> <jabber type="presence:initial" ack="no_ack"/> </request>

   <!-- Whitespace ping each 60 seconds mimic common client behaviour
and prevent connection to be closed by intermediates-->
   <for from="1" to="28" incr="1" var="counter">
       <request> <jabber type="raw" ack="no_ack" data="
"/></request>
       <thinktime value="60" random="false"/>
   </for>

   <for from="1" to="30" incr="1" var="counter">
       <request> <jabber type="raw" ack="no_ack" data="
"/></request>
       <thinktime value="60" random="false"/>
   </for>


  <transaction name="close">
     <request> <jabber type="close" ack="no_ack"/> </request>
   </transaction>

 </session>