1

My question is similar to this one: Trying to simulate users logging in but staying idle

However, there weren't really any suggestions on how to implement on jmeter.

More specifically, this is the scenario I cam trying to replicate:

Let's say xxxx number of users all log in. While those xxxx users are logged in and doing something, a new set of yyyy number of users log in and do something as well. So essentially there are now xxxx + yyyy number of users. Rinse and repeat. I want to try and take down the server.

The Ultimate Thread Group doesn't fit what I need. The reason is because within the hold load time limit, all of the requests inside that thread group will be continuously executed. I don't want that. I just need them to execute each http request once.

Is there a way to do something like this in jmeter? Or would I have to create two separate test plans and run them? Perhaps I can do some kind of loop? While xxxx users are still doing something, send in new yyyy users.

1
  • First you say "xxxx users are logged in and doing something" and then you say " all of the requests inside that thread group will be continuously executed. I don't want that. I just need them to execute each http request once." Well, which is it? Are the xxxx users continuously active or not?
    – RaGe
    Commented Apr 22, 2015 at 16:16

1 Answer 1

2

Your I just need them to execute each HTTP request once. stanza conflicts with the scenario described as the thread, representing a virtual user will be shut down when there is nothing more to do and there are no requests/loops defined.

In regards to having separate test plans: there is no need to have different test plans as you can have different thread groups which can run at the same time.

Personally I would go for the following scenario:

The idea is to start with i.e. 20 requests per second and after i.e. 1 minute set the load to be 40 requests per second and so on.

To do so:

  • Start JMeter with throughput property defined matching your initial throughput.

    jmeter -Jthroughput=120 ....
    

120 requests per minute will give 20 requests per second throughput

  • Enter ${__property(throughput,,)} into "Target Throughput" field of Constant Throughput Timer

__property function will set initial throughput to be 20 requests per second

  • Enter 60000 into Thread Delay field of Constant Timer in second Thread Group

  • Add the following code to Beanshell Sampler

    int old_throughput = Integer.parseInt(props.get("throughput"));
    int new_throughput = old_throughput * 2;
    props.put("throughput", String.valueOf(new_throughput));    
    

In this scenario each 60 seconds the load will be increased twice.

See How to use BeanShell: JMeter's favorite built-in component guide for more useful examples of extending JMeter tests with scripting and comprehensive information on Beanshell components.

3
  • In regards to executing each request just once, that's because I have multiple http request in the main thread group. So I don't need the same user looping over them in the hold load part of Ultimate thread. In regards to your scenario, I'd need to put that constant throughput timer on every http request within the thread? Another quick question, why are we multiplying the number of request and not number of user threads - or is the result the same?
    – B. V
    Commented Aug 7, 2014 at 15:57
  • You can add Constant Throughput Timer at the same level as your HTTP Requests. Throughput is calculated basing on number of concurrent requests, not matter how many virtual users are executing them.
    – Dmitri T
    Commented Aug 8, 2014 at 10:25
  • Based on the setup you provided, for the thread group that holds the beanshell, do I set the thread user to one and loop forever?
    – B. V
    Commented Aug 14, 2014 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.