jmeterload-testing

How to provide RPS in Jmeter testing?


I am new to testing using Jmeter. For now I have created a test plan which creates 1000 threads and the ramp up period is 20 seconds with the loop of 50. I am getting test results. But could you please help me how I can set the RPS so that I can know how many request per second my application can handle ?


Solution

  • You can achieve that by using Constant Throughput Timer at your test plan level.

    Constant Throughput timer allows you to maintain the throughput of your server (requests/sec). Constant Throughput Timer is only capable of pausing JMeter threads in order to slow them down to reach the target throughput. Also, it works only on a minute level so you need to properly calculate the ramp-up period and let your test run long enough.

    Here are the workarounds:

    1. Calculate the number of threads you need to achieve your target throughputs. Formula is:

      RPS * max response time in second

    2. Use the Ramp-up periods for the threads to active accordingly.
    3. Make the loop count value to Forever
    4. Set the test duration accordingly.

    As Constant Throughput Timer works on a minute level, to achieve X RPS you have to configure your "Target Throughput" value to X*60/min and "Calculate Throughput based on" value as "All active threads".

    For example, if you need 100 RPS, then "Target Throughput" value should be 6000/min in Constant Throughput Timer.