Sending in consecutive sets of users in jmeter

  • 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.

  • 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.

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2