JMeter - Constant Throughput Timer Example

Constant throughput timer in jmeter is one of the mostly used timer in jmeter software load test plan. Using JMeter constant throughput timer, You can decide how many samples should be executed per minute. Constant throughput timer will add random pauses between requests during test execution to match required throughput figure(samples per minute). Let's learn usage of constant throughput timer in apache jmeter software load test plan.

Note : If you are using constant throughput timer in your software load test plan and server is not capable to handle the load or any other time consuming elements are available in your test plan then your targeted throughput(Which is set in constant throughput timer) will be not achieved.

Add Jmeter Constant Throughput Timer In Software Load Test Plan

Generally jmeter throughput timer is being added under controller, parallel to requests. For adding constant throughput timer under controller,
  • Right click on your controller -> Add -> Select Timer -> Constant Throughput Timer. See below given image.

It will add constant throughput timer under controller.

Example : Constant throughput timer jmeter example In JMeter Software Load Test Plan

I have prepared sample constant throughput timer jmeter example software load test plan to show you how actually constant throughput timer works.

Scenario 1 : I have 1 request in my software load test plan and i wants to execute fix 20 requests per minute. My software load test plan configuration is as below.

I have set Number of threads = 1, Ramp-Up Period = 1 and Loop Count = Forever In thread group properties.


Added constant throughput timer with Target Throughput = 20 and Calculate Throughput based on = all active threads as shown in below image. That means i wants to execute 20 requests per minute.


Now if you will run above constant throughput sample load test plan, result will looks like below.


You can see that Start time difference between 1st sample and 21st sample is 1 minute. That means my targeted throughput(20 samples per minute) is achieved.

Scenario 2 : I wants to run 2 threads and execute 40 requests per minute using constant throughput timer.

So my thread group configuration is as below. I have set Number of threads = 2.


Jmeter throughput timer configuration is as below. Set Target Throughput = 40.


Test execution result will looks like below for constant throughput timer jmeter example.


You can see that Start time difference between 1st request and 41st request is 1 minute. That means 40 samples has been executed in 1 minute.

This way, You can use constant throughput timer in your load test plan to achieve targeted throughput.

2 comments:

  1. If I have 40 users and I want 80000 throughput in 2 hours. How can I set this timer.

    ReplyDelete
  2. Thanks..got idea how to setthis timer..

    ReplyDelete