I am using Jmeter normal Thread Group to simulate 1 user to loop and send a total of 1000 requests. Is the total time taken to send 1000 requests the total runtime?
Eg. 1 user, 1000 requests (looped to do so), on top right after it finishes I see a timing of 1 min 40 seconds. 1 user spends 100 seconds to send 1000 requests?
So average of 1 requests per 0.1 second see
Yes it's a viable approach. However if you want the total time to execute 1000 requests in the loop to appear in the .jtl results file and/or HTML Reporting Dashboard you could amend your test plan a little bit like:
Thread Group with 1 user and 1 loop and 0 ramp-up
Transaction Controller
Loop Controller with 1000 loops
Your Sampler
This way the Transaction Controller will generate a synthetic Sample Result and its elapsed time will be the sum of all its children (1000 Sampler executions)
Related
My Jmeter script have 2 requests Login and Logout with response time around 13-15 sec together (Login is 12-14 sec and Logout is 0.5sec). I need to run these 2 requests one after other to reach N transactions(for each request exactly) in one hour.So together 2N transactions/hour. How can I achieve this.
The most straightforward approach is just to increase number of threads in the Thread Group. If 1 user can execute both requests in 15 seconds it means that he can execute 4 requests per minute or 240 requests per hour.
However given your response times are fluctuating between 13 and 15 you might want to reduce JMeter's throughput slightly using i.e. Constant Throughput Timer or Precise Throughput Timer
As the title says, the number of samplers doesn't seem to be at the correct amount even after the test is run. In this test I am trying to test some APIs and they will be called 2000 times per minute for 60 minutes and one of the API's uploads a file and the filename changes every minute also. It gets the filenames from a CSV Data Set.
As you can see from the picture, there are only 30000 samples each request and I believe it should be 120,000 per request. Here are my Thread Properties.
I also have a Constant Throughput Timer in my Test Plan with target throughput as 2000 per minute. In one of my requests I also have a Constant Timer set for 60000 milliseconds
If you have:
4 Samplers
2 000 virtual users
and want 120 000 total executions (30 000 executions of each sampler)
you need to set Loop Count to 15 in the Thread Group
then you will get 2000 users * 4 Samplers * 15 loops == 120 000 total executions
Another option of limiting the number of executions for the particular Sampler is putting it under Throughput Controller
If you want to limit JMeter's throughput you can consider using more "precise" timers like Throughput Shaping Timer or Precise Throughput Timer
I am trying to send 1100 requests per minute to my API endpoint for a period of 5 minutes, so in total, I will make 5500 requests to the endpoint.
Based on the above requirement, Here is how I have set up my Jmeter:
It seems like I have misconfigured Jmeter, because in the end I can see Jmeter has made 8401 requests to the API instead of 5500.
What have I missed in the configuration?
Does the "Infinite" check-box need to be checked or unchecked?
The number of requests you're expecting (which is 5500) for this test plan is wrong.
As per your expectation, I think, you are making confusion between the Threads and Requests.
Ramp up is the time in which all the users arrive on your tested application server.
Requests are simulated by samplers but threads are the simulation of users.
According to your test plan:
- Total Number of Threads: 1100 vitual users
- Ramp-up time: 60 (1 min)
- Loop count: Infinite
- Test duration: 300 sec (5 min)
- No of requests/sampler in Test Plan: Unknown, assuming it 1
JMeter Execution:
JMeter will kick off those 1100 virtual users in 60 seconds according to the ramp-up time. So, (1100/60)~ 18 users will be active in every second for the first minute of your test. Each thread/user will execute the requests or samplers you have defined in your test plan hierarchy. As you have defined the loop count to infinite, each thread will execute the requests repeatedly until the test finishes. After 60 seconds, all of your 1100 users will be actively hitting those samplers/requests for the remaining 4 mins.
So the total number of requests you will be able to make through JMeter depends on your application response time.
If the avg response time of your requests is 1 second (assuming you have only 1 requests in your test plan), then you will be able to hit total 264000 (264000/240 = 1100 requests per second) for the last 4 mins (when all of your 1100 users are active) of your tests. You can also verify this accordingly by using Active Threads Over Time and Hits Per Second listeners.
So, Please double check the avg response time of your application or the requests/samplers you are using in your test plan.
If you want to control JMeter's throughput to 1100 per minute, you can use a Constant Throughput Timer at your test plan level and use target throughput value as 1100.
Do not forget to add the count of ramp-down time in your test duration. Yes, when you ramp up i.e. in the first minute generally you get more requests as threads are starting. In your case, your test duration should be 7 mins (60 seconds for the ramp-up 1100 users + 300 seconds for 5500 requests + 60 seconds for the ramp down for 1100 users).
You can also check this thread for more : How should I calculate Ramp-up time in Jmeter.
Please note- The total number of requests is related to throughput, Whereas the number of active threads performing the same activity is related to concurrency.
I am trying to send 1100 requests per minutes to my API endpoint for a period of 5 minutes, so in total I will make 5500 requests to the endpoint.
I don't know how you came with this 5500 number but this is not very correct.
Your setup means that:
JMeter will add 18 virtual users each second for 60 seconds
After 60 seconds pass JMeter will run 1100 users for another 4 minutes
The total number of requests JMeter will be able to make will mostly depend on application response time.
If you want to limit JMeter's throughput to 1100 requests per minute consider using Constant Throughput Timer or Precise Throughput Timer
If you don't want to limit JMeter's throughput but want 5500 executions either:
Set "Loop Count" to 5 (but in that case you might fail to get 1100 concurrent users)
Or use Throughput Controller in Total Executions mode so JMeter would stop after executing 5500 requests
Can someone explain to me if the loop sets the number of requests or it`s there to have an average?
If I have 100 users, ramp - up set as 0 and loop 1, does it mean that I have only 100 users and if I increase the loop to 2, does it mean that there will be 200 users doing the request?
If I needed to test with 200 users, why would I not set the users to 200? What does the loop do differently and how does it affect the result?
If you have only one request (sampler) under the Thread Group:
With loop count 1 - 100 users will execute 1 request 1 time each, 100 requests in total
With loop count 2 - 100 users will execute 1 request 2 times each, 200 requests in total
With regards to setting ramp-up to 0 - it's not the best idea, it is good to increase the load gradually, this way you will be able to correlate increasing load with other performance metrics, in particular with response time and number of requests per second.
More information: JMeter Ramp-Up - The Ultimate Guide
P.S. It might be easier to consider i.e. Ultimate Thread Group which makes the process of defining the workload easier, for example here is how you can configure JMeter to start with 1 user, increase the load up to 200 users in 60 seconds, hold the load for another 60 seconds and then gradually decrease the load:
You can install Ultimate Thread Group as a part of Custom Thread Groups bundle using JMeter Plugins Manager
This is with respect to Jmeter's loop count behavior.
Number of threads 4000
ramp up period 800
Thread count 2
Action to be taken after a sample error Continue
Same user on each iteration Yes
Delay thread creation until needed Yes
This is resulting in 8000 requests being made in 800 seconds. However, my use case is, 4000 requests in 800 seconds (count=1), then another 4000 in next 800 seconds (count=2).
What changes can I make for this?
Ramp-up period doesn't mean 8000 requests in 800 seconds, it results in:
JMeter starts with 1 virtual user and adds 5 virtual users each second for 800 seconds
Each virtual user executes Samplers upside down for the specified number of iterations
When there are no more Samplers to execute and loops to iterate the thread is being shut down
My expectation is that you only have 1 Sampler and its response time is relatively low (less than 1 second), you can check the actual amount of virtual users and produced load using Active Threads Over Time and Transactions Per Second listeners
If you need to implement 4000 requests for 800 seconds twice the easiest option would be going for the Throughput Shaping Timer and configuring it to reach/maintain 5 requests per second throughput for 800 seconds twice with 10 seconds time frame of doing nothing between loops.