0

Could someone please advise me what's the main difference between loops like for and <load loop="">? I've figured out strange behavior. I have the config file:

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel="debug" dumptraffic="true" version="1.0">
<clients>
    <client host="localhost" use_controller_vm="true" maxusers="1"/>
</clients>
<servers>
    <server host="example.com" port="443" type="ssl"/>
</servers>
<load loop="100" duration="2" unit="minute">
    <arrivalphase phase="1" duration="1" unit="second">
        <users maxnumber="1" arrivalrate="1" unit="second"/>
    </arrivalphase>
</load>
<sessions>
    <session name="one" type="ts_http" probability="100">
        <request>
            <http url='/Service.asmx' version='1.0' contents_from_file="/home/user/file.xml" content_type='text/xml; charset=UTF-8'  method='POST'>
                <soap action="Retrieve"/>
            </http>
        </request>
    </session>
</sessions>
</tsung>`

It produces about 1900 requests during the load process. But if I remove the attribute loop="100" from the <load> tag and add the for loop the number of requests decreases to 70 requests. In this case the config file looks like so:

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel="debug" dumptraffic="true" version="1.0">
<clients>
    <client host="localhost" use_controller_vm="true" maxusers="1"/>
</clients>
<servers>
    <server host="example.com" port="443" type="ssl"/>
</servers>
<load duration="2" unit="minute">
    <arrivalphase phase="1" duration="1" unit="second">
        <users maxnumber="1" arrivalrate="1" unit="second"/>
    </arrivalphase>
</load>
<sessions>
    <session name="one" type="ts_http" probability="100">
        <for var="counter" from="1" to="100" incr="1">
            <request>
                <http url='/Service.asmx' version='1.0' contents_from_file="/home/user/file.xml" content_type='text/xml; charset=UTF-8'  method='POST'>
                    <soap action="Retrieve"/>
                </http>
            </request>
        </for>
    </session>
</sessions>
</tsung>

Besides it creates 61 sessions, though the <client maxusers="1"/> and <users maxnumber="1"/> attributes doesn't change. Here's the screenshot of both reports: enter link description here

Why does it work in different ways? Logically they should work identically, just repeat the sequence of requests.

1 Answers1

1

Loop on load section will generate new users, so new sessions, cookies and all users related. Loop inside a session will re-use same users.

Rodolphe
  • 848
  • 4
  • 15
  • Thanks for the answer. That's make sense. But it looks like the loop on load section produces new sessions in the same time as old sessions run. It's shown in the graph reports that the number of simultaneous users increase to 30. http://prntscr.com/60iqis Is it the correct behavior that it doesn't wait until the first loop ends and starts new loop? – Igor Rubis Feb 03 '15 at 12:00
  • So what's the moment the new loop starts? – Igor Rubis Feb 03 '15 at 15:24