mardi 28 juillet 2015

Tigase load testing with Tsung. Registration conflict 409

I am testing Tigase by using Tsung.

My first test script would be only registering users on the Tigase server. But I have a strange problem of Tigase duplicating register requests for some user IDs.

Take a look at the tsung.dump file below.

The register request for user 43-tsung-user-2 is repeated twice. First time it is successful, the second time Tigase returns conflict error 409, meaning the user is already registered.

NewClient:1438077277.663192:1
load:1
Send:1438077277.703507:<0.89.0>:<?xml version='1.0'?><stream:stream  id='1' to='ubuntu' xmlns='jabber:client' version='1.0' xmlns:stream='http://ift.tt/wY9ouf'>
Recv:1438077277.71206:<0.89.0>:<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://ift.tt/wY9ouf' from='ubuntu' id='93e35376-1be1-413c-9285-2aa9558798d4' version='1.0' xml:lang='en'>
Recv:1438077277.717071:<0.89.0>:<stream:features><auth xmlns="http://ift.tt/11Vn6tH"/><register xmlns="http://ift.tt/wVz4qP"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><compression xmlns="http://ift.tt/SqOxcK"><method>zlib</method></compression></stream:features>
Send:1438077280.718581:<0.89.0>:<iq id='2' type='set' ><query xmlns='jabber:iq:register'><username>43-tsung-user1</username><resource>tsung</resource><password>pass1</password></query></iq>
Recv:1438077280.726568:<0.89.0>:<iq xmlns="jabber:client" type="result" id="2"/>
Send:1438077282.719153:<0.89.0>:</stream:stream>
EndClient:1438077282.719198:1
load:0
NewClient:1438077293.46312:1
load:1
Send:1438077293.4815:<0.94.0>:<?xml version='1.0'?><stream:stream  id='3' to='ubuntu' xmlns='jabber:client' version='1.0' xmlns:stream='http://ift.tt/wY9ouf'>
Recv:1438077293.484589:<0.94.0>:<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://ift.tt/wY9ouf' from='ubuntu' id='4edaf8c7-72a5-48a0-99dc-33e6a348b838' version='1.0' xml:lang='en'>
Recv:1438077293.488533:<0.94.0>:<stream:features><auth xmlns="http://ift.tt/11Vn6tH"/><register xmlns="http://ift.tt/wVz4qP"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><compression xmlns="http://ift.tt/SqOxcK"><method>zlib</method></compression></stream:features>
Send:1438077296.490041:<0.94.0>:<iq id='4' type='set' ><query xmlns='jabber:iq:register'><username>43-tsung-user2</username><resource>tsung</resource><password>pass2</password></query></iq>
Recv:1438077296.502307:<0.94.0>:<iq xmlns="jabber:client" type="result" id="4"/>
Send:1438077298.496102:<0.94.0>:</stream:stream>
EndClient:1438077298.496152:2
load:0
NewClient:1438077303.492718:1
load:1
Send:1438077303.502446:<0.96.0>:<?xml version='1.0'?><stream:stream  id='5' to='ubuntu' xmlns='jabber:client' version='1.0' xmlns:stream='http://ift.tt/wY9ouf'>
Recv:1438077303.511868:<0.96.0>:<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://ift.tt/wY9ouf' from='ubuntu' id='e3f918bc-e45d-4bb2-918d-62d85b93cec7' version='1.0' xml:lang='en'>
Recv:1438077303.515748:<0.96.0>:<stream:features><auth xmlns="http://ift.tt/11Vn6tH"/><register xmlns="http://ift.tt/wVz4qP"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><compression xmlns="http://ift.tt/SqOxcK"><method>zlib</method></compression></stream:features>
Send:1438077306.517646:<0.96.0>:<iq id='6' type='set' ><query xmlns='jabber:iq:register'><username>43-tsung-user2</username><resource>tsung</resource><password>pass2</password></query></iq>
Recv:1438077306.524358:<0.96.0>:<iq xmlns="jabber:client" type="error" id="6"><query xmlns="jabber:iq:register"><username>43-tsung-user2</username><resource>tsung</resource><password>pass2</password></query><error type="cancel" code="409"><conflict xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Unsuccessful registration attempt</text></error></iq>
Send:1438077308.520858:<0.96.0>:</stream:stream>
EndClient:1438077308.52091:3
load:0

My test should take 30 seconds, with users coming on 10 seconds intervals. Therefore 3 users should be created in the database. After the test finishes I can only see 2 users, which is also what tsung.dump is alredy saying.

Why is tsung repeating request for some users? Tsung behaves similar no matter what the load is. If i raise the load numbers I will receive the similar behavior. Most of the time the number of successfully registered users will be around the half of tsung generated user count.

Below is my tsung.xml

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/Cellar/tsung/1.5.1/share/tsung/tsung-1.0.dtd”>    
<tsung loglevel="debug" version="1.0" dumptraffic="true">
      <clients>
          <client host="localhost" use_controller_vm="true" maxusers="100000"></client>
      </clients>
      <servers>
          <server host="192.168.100.133" port="5222" type="tcp" weight="1"></server>
      </servers>
    <load>
        <arrivalphase phase="1" duration="30" unit="second">
            <users maxnumber="100000" interarrival="10" unit="second"></users>
        </arrivalphase>
    </load>
    <options>
       <option type="ts_jabber" name="global_number" value="100000"></option>
       <option type="ts_jabber" name="userid_max" value="100000" />
       <option type="ts_jabber" name="domain" value="ubuntu"></option>
       <option type="ts_jabber" name="username" value="43-tsung-user"></option>
       <option type="ts_jabber" name="passwd" value="pass"></option>
    </options>
    <sessions>
      <session probability="100" name="jabber-example" type="ts_jabber">

        <request>
          <jabber type="connect" ack="local"></jabber>
        </request>

        <thinktime value="3" random="false"></thinktime>

        <request>
          <jabber type="register" ack="no_ack" id="new"></jabber>
        </request>

        <thinktime value="2" random="false"></thinktime>

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

      </session>
    </sessions>
    </tsung>

Aucun commentaire:

Enregistrer un commentaire