Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer
    
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 Aug 7 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 Aug 8 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 Aug 14 at 22:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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