How does constant throughput timer in Jmeter works? - jmeter

how does the delay between requests is computed. I have simple Jmeter script with following 4 components :
thread group - number of threads set to 10, reset other fields have default values.
Http Sampler - named as Thread - ${__threadNum} Req -${__counter(TRUE)}
hitting URL- google.co.in
Constant throughput Timer : Target throughput- 60, Calculate Throughput on -All Active threads.
View result in table listener.
Summarized test results are below :
Please explain how the delay between the requests and number of requests to be created are computed . Please Explain other field values of " Calculate Throughput on ".
Also If i have ultimate Thread group instead of thread group, Have hold for load set to some value, so in that case how the number of requests to be sent during hold load time period are calculated?

Constant Throughput Timer pauses active threads to reach throughput level you define.
Remember 2 things:
Throughput Timer isn't able to create threads, it can only slow them down so make sure that you provide enough threads to reach desired target throughput
Throughput Timer is quite accurate on "minute" level, you need to "wait" for it to start working as expected for 60 seconds.
See How to use JMeter's Throughput Constant Timer for more details.
In some cases for some people it's more convenient to use Throughput Shaping Timer which comes with JMeter Plugins, you can configure target throughput providing multiple steps and seeing the impact on a graph.

From JMeter Cookbook by Bayo Erinle, The goal of the Constant Throughput Timer component is to get your test plan samples as
close as possible to a specified desired throughput. It achieves this by introducing variable
pauses to the test plan in such a manner that will keep numbers as close as possible to
the desired throughput. That said, throughput will be lowered if the server resources of the
system under test can't handle the load. Also, other elements (for example, other timers,
the number of specified threads, and so on) within the test plan can affect attaining the
desired throughput.

Related

How to obtain the expected TPS., which is calculated by parameters value?

I have used the normal thread group of 40 threads,180000 of throughput, and expected TPS is 3000.., But , Resulted only 2750 tps., How can I improve the TPS?
I have tried the concurrency thread group along with the shaping timer combination..
Can u pls guide me..,Thanks in Advance.
TPS or the throughput is controlled by sending the required number of requests to the target server in a unit time (seconds, minutes, hours, etc)
It is not easy or good practice to control the throughput by changing the number of threads. When the server gets slow the throughput gets low and vice-versa.
You need to introduce delays when the server responds faster and introduce more threads when the server responds slower. It is not easy to achieve the desired throughput by setting the thread count.
Please note that
throughput will be lower if the server is not capable of handling it, or if other timers or time-consuming test elements prevent it.
JMeter has a number of ways to achieve the desired throughput by introducing delays to the requests.
Using Timers
Constant Throughput Timer
Precise Throughput Timer
Througput Shaping Timer
In the above cases, you need to ensure a sufficient number of threads are available to generate the required throughputs. This solution is not efficient if a large number of threads are created than the required number of threads.
The best approach would be the test should create additional threads on-demand and introduce delays between requests as required.
In JMeter, you can achieve this with Concurrency Thread Group along with the Throughput Shaping Timer.
This video demonstrate the use of the controllers.
First of all your application must be able to handle such a load. I don't know what your 180000 of throughput, stanza means,if you put it to the Constant Throughput Timer be aware that:
it is precise enough on "minute" level
it can only "pause" JMeter to "limit" its throughput to the given value
In general you can reach out 3000 TPS with 40 users only if 1 user will make 75 requests per second which means that your application response time should be below 75 milliseconds.
If response time will be higher - you won't be able to reach 3000 requests per second with 40 users.
Also JMeter should be able to send requests fast enough, so make sure to follow JMeter Best Practices and if this is not sufficient consider using Distributed Testing
More information: What is the Relationship Between Users and Hits Per Second?

Throughput and response time using Jmeter

How can I find out maximum throughput my application can achieve within sla of 1 sec as response time.i.e response time should be within 1 sec
Currently I am using throughput controller and setting up the required throughput per minute, but I need to know max throughput my application can deliver with average response time less then 1 sec.
Using Thread Group, set Number of Threads (users) to some big number and set rump-up period to e.g.: 600s (10min)
Jmeter will slowly increase throughput and you can monitor Max response time in Summary report (column Max) - when it starts reaching 1s, you can read your desired Throughput (in Throughput column) Then I recommend set this number to Number of threads, decrease rump-up and run test for couple of hours.
Avoid using sleeps in your loop in JMeter. Beware of cache at application side. Monitor Faults in Error columns and check system health on both sides (CPU,mem,IO,Netw,...)
Please note that Throughput Controller does not control the throughput.
Following is from the JMeter official site.
This controller is badly named, as it does not control throughput.
Please refer to the Constant Throughput Timer for an element that can
be used to adjust the throughput.
You may use plugin Throughput Shaping Timer if you want to have controlled throughput changing with the time.
Change the threads (virtual users) and throughput to check the maximum through that can be handled by the server.
Use Duration Assertion to check the response time of each desired sampler.
Just don't limit JMeter's throughput.
Start with 1 thread (virtual user) and gradually increase the load until you see response times exceeding 1 second (you can use i.e. AutoStop Listener plugin for automatically stopping the test when average response becomes higher than 1 second)
Once done you can look into Transactions per Second and Server Hits per Second, it will give you the number you're looking for.

Effects of number of threads when controlling throughput in JMeter

I have a Thread-Group that runs a set amount of time and control the throughput through a Constant Throughput Timer. So in theory, about the same number of Samples should be processed, regardless of the number of Threads deployed.
E.g. ignoring warmup/down the test runs for 10 min with a throughput of 5 Threads/s, therefore roughly 3000 Samples should be processed.
How does changing the number of Threads effect the test?
Ignoring the startup/shutdown period, will the results of the test differ if I have 1000 or 2000 Threads, if only 100 can be completed in a minute?
How can I work out the number of Threads required, given the throughput?
Constant Throughput Timer
Can only pause threads to match the given throughput value. It won't kick off more threads if you don't have enough defined at Thread Group level.
Is accurate enough on minute level. If your test lasts less than a minute - consider other options like playing with ramp-up.
For more information check out How to use JMeter's Throughput Constant Timer
Also it might be better and easier to use Throughput Shaping Timer available via JMeter Plugins project which extends CTT capabilities and provides easy understandable visual view of expected throughput
The number of threads will impact results if your server faces slowdowns.
If so and you don't have enough threads then you will not be injecting the expected load and end up with less transactions performed.
If you have more, then the target load will be injected potentially leading to server crash.
Finally be aware that if you don't make your test last enough, jmeter will potentially inject more than expected because it needs some time to reach the expected req/s , it will inject more at begining.

How generate maximum hits/s

I have recorder a simple flow using jmeter. I have multiple http requests under one thread group. I am trying to run this thread group for 50 concurrent users in blazemeter. But when ever i try to run the jmx file i can see that htis/s is around 3 sec. Though my rampup time is 0 & thread is 50. My understanding is if the users are concurrent & each user (thread) have 3 requests to make, then minimum hits/s should be 50.
I have added a constant throughput timer at the bottom of the thread group & a throughput controller. In the timer target throughput is set to 300 & in the throughput controller throughput is set to 100 with percent execution.
How do i achieve maximum hits/s in blazemeter? Or am i missing something here. Thanks in advance.
I think that you're misusing Constant Throughput Timer.
Throughput of 300 requests per minute gives 300/60 = 5 requests per second
Constant Throughput Timer works on minute level so make sure that your tests lasts longer than 1 minute
Each JMeter thread representing virtual user executes nested samplers upside down, when thread has nothing more to do it is being shut down. Make sure that you have enough job for threads and if not - make sure that you provide enough loops (see point 2 as well)
Constant Throughput Timer cannot kick off any new threads, it is capable of throttling (pausing) current active threads to limit load to throughput defined. So try increasing threads count.
For more information refer to How to use JMeter's Throughput Constant Timer guide
You may also like to use Throughput Shaping Timer instead, it provides a little bit more flexibility than JMeter's CTT.

throuhput keep descreasing in Jmeter benchmark

When I'm doing Jmeter benchmark, the throughput and transfer bytes/sec keep decreasing as time goes by? Who can tell me why?
When the test begins, it has a high throughput , but it decreases all time, and the stable status can't be accessed.
JMeter kicks off threads representing virtual users according to your ramp-up. Each thread starts executing samplers upside down (or according to parent Logic Controllers). When thread doesn't have more samplers to execute and no more loops to iterate it's being shut down.
You can consider the following approaches to implement desired load scenario:
Provide enough iterations via Thread Group or Loop Contoller
Use Ultimate Thread Group which provides easy way of defining a load scenario so you will be able to set initial users number, ramp up duration and users arrival rate, time to hold the load, and define ramp-down.
JMeter provides Constant Throughput Timer which can be used to set precise load in "requests per minute" so you'll be able to control target throughput. You can also use it in conjunction with Beanshell Server - this way you can dynamically change throughput on-the-fly.

Resources