python_interest
python_interest

Reputation: 874

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 ?

Upvotes: 1

Views: 10626

Answers (2)

Dmitri T
Dmitri T

Reputation: 168002

In order to determine the delivered load you can generate HTML Reporting Dashboard which provides Hits Per Second chart (and many more)

enter image description here

If you want to define the desired RPS - the easiest option is going for Concurrency Thread Group and Throughput Shaping Timer combination. You can define the desired throughput in terms of requests per minute/second and given you connect the aforementioned test elements via Feedback Function JMeter will be able to automatically kick off extra threads to reach/maintain the desired throughput in case if current amount is not enough.

You can install these plugins using JMeter Plugins Manager

enter image description here

Upvotes: 4

Masud Jahan
Masud Jahan

Reputation: 2978

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.

Upvotes: 2

Related Questions