Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tsung is failing to perform constant load #262

Open
olka opened this issue Oct 10, 2017 · 7 comments
Open

Tsung is failing to perform constant load #262

olka opened this issue Oct 10, 2017 · 7 comments

Comments

@olka
Copy link

olka commented Oct 10, 2017

Recently I've started evaluating tsung and noticed that it's impossible to generate constant load to the server.
According to documentation and this advice my configuration file looks like this:

<!DOCTYPE tsung SYSTEM "/usr/local/Cellar/tsung/1.7.0/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
  <clients>
    <client host="localhost" use_controller_vm="true" maxusers="999000" />
  </clients>
  
<servers>
  <server host="192.168.1.9" port="5050" type="tcp"/>
</servers>

   <load duration="250" unit="second">
    <arrivalphase phase="1" duration="200" unit="second"> 
    <users arrivalrate="900.0" unit="second"/> 
  </arrivalphase>
     </load>

 <sessions>
  <session name="tsung-benchmark" probability="100" type="ts_http">
    <request> <http url="/counter" method="GET" version="1.1"></http> </request>    
  </session>
 </sessions>
</tsung>

But results are totally inconsistent and rather showing bursty than constant load profile.
Please also notice huge gap between load windows on server graph.
Tsung results
Server results
OS: OSX 10.11.6
Tsung version 1.7.0

UPD: using instructions from this article I was able to produce somewhat constant load. But as you can see even those results are far from stable

Name highest 10s mean lowest 10s mean Highest Rate Mean Rate Mean Count
connect 37.34 sec 1.08 sec 206.9/sec 68.11/sec 7.03sec 18324
page 0.47 sec 0.23 sec 7375/sec 4757.57/sec 0.34sec 872659
request 0.47 sec 0.23 sec 7375/sec 4757.57/sec 0.34sec 872659
session 2mn 18sec 20.74 sec 151.7/sec 58.82/sec 1mn 24sec 10000
@nniclausse
Copy link
Contributor

You are not using Tsung as it was designed for (simulate complex sessions, and run many in parallel)
If you only want to send very quickly many requests to a single url, you should start a single session (or a few) and use a loop in this session. Creating a new session is much more expensive for Tsung than sending a new request inside a session. 900 new sessions / sec is quite a lot for a single node.

@olka
Copy link
Author

olka commented Oct 13, 2017

Thanks for the answer @nniclausse! It makes perfect sense from the results that I'm seeing at the moment.
But the only drawback in your solution is that it's impossible to specify arrival rate in a loop.
So I'm still confused what would be the best way to generate constant load without huge spikes and gaps (let's say 3000 rps)?

@tisba
Copy link
Collaborator

tisba commented Jan 4, 2018

Why do arrival rate and looping exclude each other, @olka?

If you want to hit ~3k rps, you can let sessions loop (even forever) and add 100 clients per second up to 3000 clients.

In the loop you do a request then wait for ~1 sec.

After 30 seconds, you have done your ramp up and should reach your desired throughput.

@eleschynskyy
Copy link

eleschynskyy commented Jan 18, 2018

@tisba , cld you please clarify re looping?
here 2 kinds of looping have been mentioned: loop attribute inside load-section and "for" within "session".
According to the answer there: "Loop on load section will generate new users".
I got confused..
From one side according to official documentation if I want to produce classical "ramp up period" + "static load" possibly I have to specify:

  • phase_1: with the duration of ramp-up + arrivalrate + users maxnumber="N"
  • phase_2: with the duration of static period + arrivalrate + users maxnumber="N"
    This setup will accumulate users according to specified arrivalrate and will not go above maxnumber.

But from other side according to provided answer re loop logic inside load section I MUST specify it as well in order to have users accumulated. B/c formally w/o "loop" it looks like constant load w/o accumulation of the users.

@tisba
Copy link
Collaborator

tisba commented Jan 21, 2018

I'm not sure I follow. But I can try it :)

Every user launched in tsung run to completion (unless the test gets aborted). That said, if you let a user loop inside the session, it will be active for ever (or the test aborts).

You only need one arrival phase. In this phase you define your arrival rate and maxusers. To limit the overall test duration, you can use <load duration="1" unit="hour"> (see http://tsung.erlang-projects.org/user_manual/conf-load.html#duration-of-the-load-test).

Let's say you want to have 3000 users, a ramp up time of 5 minutes and a total test duration of 1 hour (note that the arrival phase is 6 minutes, that is to ensure that all 3000 users get launched; tsung's arrival rates are probabilistic):

<load duration="1" unit="hour">
  <arrivalphase phase="1" duration="6" unit="minute">
    <users interarrival="600" unit="minute" maxnumber="3000"></users>
  </arrivalphase>
</load>

In your session you can use this:

<session name="loop-forever" type="ts_http" probability="100">
  <for var="counter" from="1" to="2" incr="0">
    <request>
      <http url='/hello' version='1.1' method='GET' />
    </request>
  </for>
</session>

@tisba
Copy link
Collaborator

tisba commented Jan 21, 2018

@tisba
Copy link
Collaborator

tisba commented Jun 2, 2018

Hey @olka. Are you still having issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants