Jmeter - concurrency thread group with throughput sample - jmeter

I have a JMeter test plan with a concurrency thread group and a throughput shaping timer.
below is a screenshot of the test plan.
The post requests are two requests which are sent one after another for a device. there should be 200 transactions/requests needs to sent per sec which I am controlling by target concurrency in concurrency thread group, start RPS and end RPS in the throughput shaping timer.
the total TPS should be 200 ( sum of the first and second requests in the test plan) and the device would be different in each thread. can this be achieved with the above test plan. I see that post-event 2( second post-event in the test plan) are not sent for some of the devices towards the end of the test.

You should be able to achieve the target throughput (RPS) with the Throughput Shaping Timer with the feedback function in the Concurrency Thread Group.
RPS can be set on the Throughput Shaping Timer
This short video demonstrates the use of various options available in JMeter for Throughput Controlling.

Yes, it's possible, but be aware that "Concurrency" in the Concurrency Thread Group is the number of threads (virtual users) and the number of requests per second will be equal to the number of threads only if your application response time is 1 second.
If it's higher - you will need to proportionally increase the "Concurrency" in the Concurrency Thread Group.
More information: What is the Relationship Between Users and Hits Per Second?
You can connect Concurrency Thread Group with the Throughput Shaping Timer via Feedback Function, this way JMeter will be able to kick off extra threads if the current amount is not sufficient in order to reach/maintain the desired amount of requests per second.
Also re-consider using listeners in your test plan, they don't add any value but just consume valuable resources, you should be running JMeter tests in non-GUI mode with all listeners enabled/deleted and once test finishes open the .jtl results file with the listener of your choice or generate HTML Reporting Dashboard

Related

The example related just for one sampler for "throughput shaping timer" does not give much idea in Jmeter

i want to use the Throughput shaping timer for my project in Jmeter to set the "requests per seconds" to any level that i want. i read the article below.
(RPS : requests per second)
https://www.blazemeter.com/blog/using-jmeters-throughput-shaping-timer-plugin
it is useful but not sufficient the uses in real life. anyone doesnt send only one sampler. in my project i send a lot of samplers (http requests) and i want to set the RPS for all samplers in total.
for example if there are 20 samplers and i want set the RPS to 100. what jmeter does now?
should i bring the all samplers under the Throughput shaping timer or what?
i tried this method but i coudnt achieve the numbers even if i increase the number of threads (this was be performed in the article).
JMeter Timers obey JMeter Scoping Rules so it's sufficient to add a single Timer and it will apply the desired throughput to all Samplers it its scope. A good position would be a direct child of the Thread Group
Throughput Shaping Timer per se can only pause JMeter threads to limit execution rate to the given number of requests per second. If you don't have enough threads in order to conduct the required load - it won't be able to do anything about it so either go for Concurrency Thread Group and connect it to the Throughput Shaping Timer via Feedback Function or increase the number of threads so it would be enough in order to deliver the load.
Also remember 2 constraints:
JMeter itself should be able to send requests fast enough so make sure that you're following JMeter Best Practices and JMeter has enough headroom to operate in terms or CPU, RAM, etc.
System under test should be able to respond fast enough as JMeter will wait for the previous response before sending the next request and in case of increased response times the throughput will go down

Jmeter- how to achieve throughput same as the user count in jmeter

How can I acheive below transaction per hour. I tried to control login by using once only controller ,But transaction per hour is still more than 70. How to handle this?
Overall User count is 70
Transaction per hour for login -- 70
Transaction per hour for homepage -- 100
If you need JMeter to execute exact amount of transactions, not more, not less - go for Throughput Controller
Similarly you can configure 100 homepage transactions.
In order to evenly distribute 70/100 transactions for the duration of one hour time frame you can play with ramp-up period and Constant Throughput Timer
Be aware that you won't be able to achieve different throughputs for different samplers under the same Thread Group as JMeter will always wait for the previous sampler to finish prior to executing the next one hence it will act at the speed of the slowest sampler.
More information: Running JMeter Samplers with Defined Percentage Probability
A couple of other options:
Use the Arrivals Thread Group. This TG will allow you to
configure the desire average throughput (ATP); the TG will
instantiate the required threads needed to achieve the ATP goal (no
guessing)
Use the Concurrency Thread Group together with Throughput
Shaping Timer. These option will also autoscale the number of Vusers
see more information here
Be aware that the downside of these options is that vusers is are instantiate using a fixed pacing. In general, this is not how rusers interface with an application in the real world.

Jmeter- Thread Group- Thread Properties

Our requirement is to execute
1 user/thread, 10 requests/sec, Total requests = 10,000
With current Thread Properties not able to achieve.
Only one user/thread send 10 request/sec and total should be 10000 requests. Any other way to achieve this in Jmeter ?
Is following approach is correct ? We used Loop controller. So each request will repeat 10 times
You will be able to achieve 10 requests/second with 1 virtual user only if your response time will be 100 milliseconds. If response time will be more than 100 milliseconds - you will not be able to reach the desired load.
If your application fails to respond in 100 milliseconds time frame - most probably you've found a performance bottleneck and you can report this to your application developers.
If you have some time to investigate the issue you can try to provide more information, i.e. what is the average response time, what are minimum, maximum, quantiles, the actual number of requests per second, etc, all this information can be retrieved using Aggregate Report listener.
Normally when people are looking for the answer if the application under test can support X requests per second they use > 1 virtual user as load test should represent real life usage of the system under test and 1 thread (virtual user) isn't normally associated with performance testing and derivatives.
So probably you should reconsider your approach to testing and try increasing the number of threads (virtual users). The throughput can be controlled using Precise Throughput Timer or Constant Throughput Timer. However be aware that the above timers can only pause JMeter to slow it down to the desired throughput. Another approach is using Concurrency Thread Group and Throughput Shaping Timer combination, they can be connected using Feedback Function so JMeter will kick off extra threads in order to reach/maintain the desired number of requests per second.
You can install Concurrency Thread Group and Throughput Shaping Timer using JMeter Plugins Manager

JMeter - Achieving Desired Requests Per Second

I'm having trouble achieving the desired 'requests per second' using a combination of 'bzm - Concurrency Thread Group' and 'Constant Throughput Timer' in JMeter.
Structure
My test is structured as follows:
Thread Group 1
Constant Throughput Timer
HTTP Request
Thread Group 2
Constant Throughput Timer
HTTP Request
Thread Group 3
Constant Throughput Timer
HTTP Request
Thread Group 4
Constant Throughput Timer
HTTP Request
Numbers
I am wanting to achieve 160 concurrent users for each of the Thread Groups.
Thread Group 1 I am aiming to make 350 requests per second, the others are aiming for 160 requests per second.
The Thread Groups have 160 as the 'Target Concurrency'.
Constant Throughput Timer has 21000 for Thread Group 1 (350 rps*60 = 21000 per minute).
Constant Throughput Timer has 9600 for the others (160 rps*60= 9600 per minute).
All of them have 'Calculate Throughput based on: this thread only'
I'm currently only getting a throughput of around 80 rps for Thread Groups 2-4 and less than 10 for Thread Group 1.
I've allowed JMeter to use 4GB of RAM and I'm not using all of this during the test. When I remove all Throughput Timers, I can achieve up to 14k rps.
Am I missing something? Is there a better way to achieve my desired throughput?
The reasons of not achieving desired number of requests per second could be in:
You simply don't have enough threads in thread group
JMeter cannot send requests fast enough due to lack of resources on its side
Application under test cannot respond fast enough
With regards to point 1 be aware that Constant Throughput Timer can only pause threads in order to limit JMeter's throughput to the desired number of requests per minute.
Given you use Concurrency Thread Group it makes more sense to switch to Throughput Shaping Timer which can be connected to the Concurrency Thread Group via feedback loop so JMeter will be able to kick off extra threads to achieve the desired RPS rate.
You can install Throughput Shaping Timer using JMeter Plugins Manager
With regards to point 2: make sure you're following JMeter Best Practices and monitoring baseline OS health metrics on machine where JMeter is running, if there is lack of CPU or RAM you might need to consider Distributed Testing
With regards to point 3: the same approach as for point 2 + use profiling tools to see where application spends the most of time

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.

Resources