In my test plan , I only have one Thread Group.
Thread Group Screenshot
I have CSV file with 10 users and 15 API requests in Loop Controller.
Loop Controller Screenshot
All of my requests are passing, An average of 55 requests/second were being sent but I want to know the maximum capacity of the server.I need to sent 150 requests per second, So I added Constant Throughput Timer with Target Throughput 9000 Constant Throughput Timer Screenshot .But it is still sending an average of 55 requests/ second. Here is the screenshot of command line run output. Output
Can anyone help me understand what I am doing wrong here ? Which values should I change in order to acheive 150 requests per second ?
JMeter sends request, WAIT for answer, send another request
If you add timer, it basically add some sleep to this -> you can't increase throughput, only decrease. Check manual https://jmeter.apache.org/usermanual/component_reference.html#Constant_Throughput_Timer
You should check your server - Load, CPU, Memory, IOs - disks, network ...
Check your JMeter machine as well
Are the answers from server alright? Do you check e.g. HTTP 200 OK?
You can try add more ramp up time, inscrease/decrease user count, but first check your server!
You're trying to reach 150 requests per second with each thread, you need to amend at least this bit:
You're trying to reach 150 requests per second with 10 users which means that each user needs to execute 15 requests per second. It's only possible if response time of your application is 66 milliseconds or less and the average response time of your application is around 200 milliseconds so it explains the actual result
JMeter's Constant Throughput Timer can only pause the threads in order to limit requests execution rate to the desired value, it won't kick off extra threads if current amount is not sufficient.
So the options are in:
Increase the number of threads in the Thread Group to i.e. 50 (you may need even more)
Or consider switching to Throughput Shaping Timer and Concurrency Thread Group combination, the Throughput Shaping Timer is more "precise" and it can be connected to the Concurrency Thread Group via Feedback Function so you will be able to kick off more threads to reach and maintain the desired throughput
Related
I am conducting a performance test (TPS) using jmeter.
I am requesting about 10,000 TPS, but the following two results are different.
(Position that 10,000 TPS responds normally)
1000 thread x 600 target throughput(in samples per minute)
100 thread x 6000 target throughput(in samples per minute)
I think the two results should be the same, but why is the response time delayed as the thread increases?
I think the two results should be the same - why they would be the same?
Let's imagine your system has fixed response time of 1 second, in that case:
With 1000 threads you will get 1000 requests per second and you can limit the throughput to 10 requests per second using the Constant Throughput Timer
With 100 threads you will get 100 requests per second, no limiting is required
And what if response time is 2 seconds?
With 1000 threads you will get 500 requests per second
With 100 threads you will get 50 requests per second
Constant Throughput Timer:
acts precise enough on "minute" scale, if your test lasts less than minute it might not apply the throughput
can only pause the threads to limit the throughput (requests per minute) to the desired value. If current number of threads is not enough in order to conduct the required load - the time won't have any effect.
If you want to send requests at the rate of 10000 TPS it worth considering going for the Throughput Shaping Timer and Concurrency Thread Group combination connected via the Feedback Function in this case JMeter will be able to kick off extra threads if current number is not sufficient.
But also be informed that:
JMeter should be able to start as many threads as needed to send 10000 TPS so make sure to follow JMeter Best Practices or even consider going for Distributed Testing Mode
Application needs to be able to handle the load and respond fast enough, JMeter waits for the previous response before starting the new request so if application is able to serve i.e. 5000 requests per second only you won't be able to reach 10000 by any means
I have tried with concurrent users thread group pairing with throughput timer , but the transactions were low , Is there any other way to achieve the above scenario
#dmitri
I happened to use this function ${__tstFeedback(throughput-timer,25,2500,100)} in my concurrent thread group still I what could see is not more than 200 transaction/sec
Concurency thread group setup
Throughput shaping timer
Transactions per sec
I always see this additional request added to my summary and aggregate reports results Concurrency Thread Group-ThreadStarter:
Concurrency Thread Group-ThreadStarter: 15034 27152 314 67905 17924.575009281336 0.5485566050286018 27.972210128343956 101.83185588876516 3.662355576998932 3727.836304376746
It might be a valid scenario depending on your application response time.
In order to be able to achieve 500 requests/second with 25 users each user needs to be able to execute 20 requests per second which means that your application response time needs to be 50 milliseconds or less.
If response time is above 50 milliseconds the number of requests per second will reduce proportionally.
If you have more than 1 request in your transaction - the response time constraint changes correspondingly like 2 requests - 25 milliseconds max, etc.
JMeter's Constant Throughput Timer can only capable of pausing the threads to limit the number of transactions per minute to the given value, if the current amount is not enough - it won't kick off extra threads. So it's your job to provide sufficient number of threads in the Thread Group
As the alternative you can consider going for Throughput Shaping Timer and Concurrency Thread Group combination, they can be connected via Feedback Function so if current number of threads is not enough to reach/maintain the desired throughput - more threads will be launched
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.
I am so much confused with Jmeter test configuration. I found lots of answers but non those clear my doubt. My thread group contain 10 threads and all are in active state. I want to hit 20 requests per second to server. Load need to last for 60 seconds.
I put
thread count : 20
Ramp Up Period : 1
Loop Count: 60
Is it correct method to hit 20 requests/second last for 60 seconds?
For Request Per Second we should not calculate manually, instead leave the headache to JMeter. Just make sure, to have enough Threads to reach that TPS and JMeter will control the pacing. If the Threads are less and Request Per Second is more, than JMeter cant to anything and RPS wont be met.
Use Throughput Shaping Timer to achieve Request Per Second Throughput Shaping Timer
How Many Threads I Need To Produce Desired RPS?
Threads pool size can be calculated like RPS * <max response time> / 1000. The more rate desired the more threads you will need. The more response time service have the more threads you will need.
For example, if your service response time may be 2.5sec and target rps is 1230, you have to have 1230 * 2500 / 1000 = 3075 threads.
It is better to have some threads overhead to handle unexpected response time spikes. But beware of too much overhead, it will lead to "final spike".
Use Following settings in Thread Group and Throughput Shaping Timer:
Increase Number of Threads if 20 TPS is not met.
You can use stepping thread group or concurrency thread group instead of basic thread group to achieve your desired results.
https://jmeter-plugins.org/wiki/ConcurrencyThreadGroup/
Your configuration will be correct only if:
You have only one Sampler
It's response time is equal to 1 second
Correct configuration would be something like:
The best approach would be going for Concurrency Thread Group and Throughput Shaping Timer combination. They can be connected together via Feedback Function allowing the Concurrency Thread Group to kick off more threads if current amount is not enough to conduct the required load.
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