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
Related
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.
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 given a task in which I have to test my app for an hour with 300 TPS.
I have added my HTTP req in Jmeter and I need to configure below parameters to achieve my target
target concurrency
Ramp up time
Ramp-up steps
Hold target
thread iteration limit
I could guess by name few of these but still I am not quiet sure how to work around it to achieve my target. I am new to Jmeter can any one please help.
I assume you're talking about Concurrency Thread Group so answers are:
target concurrency - we don't know, it depends on your application response time, i.e. if response time is 1 second - go for 300, if response time is 2 seconds - go for 600, etc. If you don't know the response time you can put "sufficient" number of concurrent threads, for example 1000 and use Throughput Shaping Timer for limiting the load to 300 TPS
Ramp up time - again, we don't know your requirements. I can only recommend increasing the load gradually so you could correlate increasing load with increasing response time or number of errors so for example start with 1 TPS and increase the load to 300 TPS in i.e. 15 minutes and leave it running for 1 hour
Ramp-up steps - again, we don't know your requirements, start with above recommendation and adjust ramp-up period up or down as needed
Hold target - at least 60 minutes or 3600 seconds plus any ramp-up time
thread iteration limit - leave blank otherwise your test may end earlier than you expect
Example Concurrency Thread Group combination:
the values given in Schedule Feedback Function are for reference only, the example means that the Concurrency Thread Group will start 1000 threads initially with maximum of 1500 threads and have 300 spare threads in pool, hopefully it will be sufficient to produce 300 TPS load which is set by the Throughput Shaping Timer
As per the Documentation - "Of course, if the server is not able to handle such a load, the throughput will be lower." How is this behavior handled and throughput calculated?
Suppose I set the target throughput as 1500/min but my system could handle only 1000/min, what kind of feedback behavior is expected by JMeter and how is the total throughput affected?
Will the JMeter still try to achieve 1500/min with higher error rate (for failed requests) or JMeter shoots the throughput to 1500/min but gradually comes back near to 1000/min based on certain factors like error rate? If yes, what are the factors determining this step-down, any insight/reference to understand this step-down behavior?
Either you do not have enough threads in the test plan to achieve your desired TPS or your application response time is higher.
The total number of requests you will be able to make through JMeter depends on your application response time.
So you will need at least 25 threads to achieve 1500/min if your average response time is 1 second (assuming there is only 1 request).
If throughput isn't increasing even after providing with enough threads but the response time increasing and some of your requests got failed, then this indicates the performance bottleneck!
JMeter cannot send requests faster than your application is capable of responding. If your application can only serve 1000 requests per minute - you will have 1000 requests per minute no matter how many threads you have in the Thread Group or how many requests per minute you specify in the Constant Throughput Timer.
Also be aware that:
Constant Throughput Timer can only pause the Threads, it will not do anything if the current amount of threads is not enough to reach/maintain the desired throughput
Constant Throughput Timer is accurate enough on minute level so consider choosing proper ramp-up settings otherwise you can stress your application during first minute of your test
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