First of all I apologize for my bad English, I'll try to be clear.
I tried to run a Test in jmeter with 60 threads with 600 seconds for Ramp-up during for example: 15 minutes. The problem is that as I understand jmeter should distribute the load in at most 1 hits per second, which is not happening.
I'm using a Constant Throughput Timer with "Calculate Throughput based on (this thread only)" on 1 sample per minute. When the minute passes, the requests begin to coincide up to 10 hits per second.
I understand that this happens because the first thread executes a request and when the minute passes another thread executes a request and so on until the ramp up time is over.
The question is: is there any way to limit the hits per second, achieving, for example, in a test of 180 requests per minute, the hits per second reach a maximum of 3? exactly distributing the load evenly?
I hope I was clear
Thanks!
Yes, but you're using:
Not very accurate timer
The timer is not properly configured, it limits the number of request per minute for 1 thread and not considering other threads. Due to concurrency you can have > than one hit per second, you need to switch to all active threads (shared)
It will be much easier to use either Throughput Shaping Timer or Precise Throughput Timer, they are more accurate and self-explanatory.
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 am trying to run a post request in Jmeter. I want 10 requests to fire per second over a period of 1 hour. How could I achieve this?
Looking around, Constant Throughput Timer seems to be the popular option.
But for some reason, no matter what I switch around, I end up with only 500 requests. Can I please get some guidance as to why? It feels like such a basic option yet I simply can't figure it out. Been at it for hours and just not going anywhere.
My settings (For testing just trying with 2 mins, so I expect to end up with 1200 requests).
Thread Group:
Number of threads: 20
Ramp Up Period: 1
Scheduler checked.
Duration Set for 120 seconds (2 mins).
I then go on to add the Constant Throughput Timer. I set the value to 600 (Thus 10 requests per second).
As mentioned above, running this gives me 500 requests... I was expecting 1200 requests.. Why? Even if I extent mu duration to 3 mins, it would still be 500. Please help.
Constant Throughput Timer can only pause the threads to the desired throughput so if you want to achieve 10 requests per second with 20 users your application must be at most 500ms, if it will be higher - the number of requests per unit of time will be proportionally less.
So first of all try increasing the number of threads
Make sure to follow JMeter Best Practices (just in case JMeter is not capable of sending requests fast enough)
You may find Concurrency Thread Group and Throughput Shaping Timer more convenient and precise, moreover this combination can kick off extra threads if current amount is not enough in order to reach/maintain the defined throughput
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.
My goal is to simulate 500 users that perform certain requests on the website in an amount of time of five minutes.
To make the test come as as close as possible to reality, I want to add a thinking time between requests (here: two seconds). The problem is no matter what I do, the timers get ignored. To give you an example, I would like to perform an login request every 2 seconds. Here is data of the thread group:
Number of Threads: 500
Ramp-Up Period: 300
Loop Count: 1
So what I did do till now to achieve this:
I used the constant timer and put it at as a child to my request, that didnt work, timer gets just ignored, no matter what value I use.
I tried the constant throughput timer, but that didnt work too, values get ignored.
What am I doing wrong. I added a screenshot so you are able to see where I did put the constant timer in my test plan.
Screenshots of my testplan:
In your case you can work without timers, you can use the Ramp up period to be Number of threads * 2 (seconds) to start Thread every 2 seconds approximately.
So in your case just put Ramp-Up Period: 1000 (and remove timer)
You are using wrong timer, Constant Timer just adds delay of 5 seconds before each request. If you want JMeter to perform login each 2 seconds you should consider switching to Constant Throughput Timer
Remember that Constant Throughput Timer acts precisely enough on minute level only so you might need to play with ramp-up period on Thread Group level in order to limit threads execution rate during first 60 seconds. Alternatively you can consider using Throughput Shaping Timer plugin
I need to create a load test in which there's a maximum of 4 concurrent users per second. Then I need to repeat this for an hour.
Is there any way to achieve this in JMeter?
I have tried using this configuration:
Number of Threads: 4
Ramp-up period: 1
Loop count: Forever
Duration:3600
And to make sure that this run exactly for an hour I have also used a Runtime Controller with the same "3600" runtime value.
But these creates more concurrent users per second than what I need and besides it's also unlikely to have that many concurrent users as user usually take so time to think before they do something and this wasn't reflected in my configuration so also tried using Constant Throughput timer , but this only confused me more.
I'm sure I need to use the Constant Throughput Timer, but I don't have the faintest idea of how to do it in my case.
If a use the Constant Throughput Timer, how should I configure the Thread Properties (Number of threads, ramp-up period,loop count, schedule) ?
Do I really need to use a Runtime Controller, to ensure that the test plan runs exactly for an hour or is enough to specify a duration value of 3600?
Constant throughput timer allows you maintain throughput of your sever. (req/sec)
here requests are samplers. Threads are users/clients which are requesting server using samplers.
I hope this have cleared distinction between request and user i.e. sampler and thread.
Now Constant Throughput Timer works on sampler per minute basis. so for your requirement of 4 req per sec. it becomes 240 requests per minute.
and you want to maintain this throughput among all threads (if you have multiple thread groups) or among a single thread group if you have single thread group.
So JMeter engine will start all threads with given ramp-up but will allow only 4 samplers to executes at a given seconds i.e. only 4 request per second.
Thus throughput is achieved among all threads and you can continue this for a specified time using either ways,
Test duration
Runtime controller
I hope it cleared your confusion and solved the issue.