I was working with IBM RPT, in RPT we can have iteration control, means you can execute definite number of loops for fixed time, e.g, I can have 30 loops (iterations) for 30 minutes. How can we achieve this scenario in jmeter?
You can use for that Constant Throughput Timer component.
This timer introduces variable pauses, calculated to keep the total throughput (in terms of samples per minute) as close as possible to a give figure
Or use ThroughputShapingTimer
Related
I have created a performance test script as below. I am running 4 Thread Groups in parallel (Even though there are 14 Thread Groups, only 4 are enabled and I am running only those enabled 4 Thread Groups). I have used default Thread Groups.
I have used Flow Control Action to simulate the user think time and set it as 3 seconds.
My requirement is to achieve Throughput as 6.6/seconds. What is the best way to achieve it? Also, does user think time creates any impact on Throughput?
As per JMeter Glossary:
Throughput is calculated as requests/unit of time. The time is calculated from the start of the first sample to the end of the last sample. This includes any intervals between samples, as it is supposed to represent the load on the server.
The formula is: Throughput = (number of requests) / (total time).
So basically throughput is the number of requests which JMeter was able to within test duration time frame. If you introduce artificial delay of 3 seconds - it will make the overall throughput lower
Other (and the main factor) is your application response time because JMeter waits for previous request to finish before executing new one so there could be 2 options:
The amount of threads in your Thread Groups is not sufficient to create the desired throughput. If this is the case - just add more threads (virtual users) in Thread Group(s)
The amount of threads in your Thread Groups is too high and you're getting higher throughput that you expect. If this is the case you can pause JMeter even more by adding Constant Throughput Timer and specifying the desired number of the requests per minute you want to have. If you need 6.6 requests per second it will mean 396 requests per minute
Also remember that JMeter itself must be able to send requests fast enough so make sure to follow JMeter Best Practices
My suggestion is to consider using 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.
As for the Think Time (TT), it should be a business requirement that emulates the pauses that users take when using the application in the real world.
I am trying to stress test my server.
To do so I am using Jmeter and here is my set up:
I use
my Setup
Thread: 1000
schedule for 3 mins
So as you see I keep going with 1000 thread for a period of 3 mins.
But when I look at the throughput I only get around 230 per second
results
So what should I do to increase the through put to for example 1000000 per second? How come increasing the thread which I assume means more load does not increase throughput?
According to JMeter Glossary
Throughput is calculated as requests/unit of time. The time is calculated from the start of the first sample to the end of the last sample. This includes any intervals between samples, as it is supposed to represent the load on the server.
The formula is: Throughput = (number of requests) / (total time).
Throughput explicitly relies on the application response time. Looking into your results, the average response time is 3.5 seconds therefore you will not get more than 1000 / 3.5 = 285 requests per second
Theoretically you could use Throughput Shaping Timer and Concurrency Thread Group combination, this way JMeter will kick off extra threads if the current amount is not enough to reach/maintain the desired throughput, however looking into 8.5% error rate and maximum response time for your application > 2 minutes my expectation is that you will not be able to get more throughput because most probably your application is overloaded and cannot respond faster.
Throughput measures the number of transactions or requests that can be made in a given period of time. basically, it lists the number of requests server managed to serve in a given time period. Throughput value depends on lot of factors and maybe your application under test not able to cater the expected load.
So with 1000 threads, you can't expect a 1000 throughput.
It's up to you to find out how much throughput your application can handle. For that maybe you need to do different optimizations on your side like optimize your script, distribute load via JMeter execution, increase theard count,...etc
I'm trying to generate seasonal load pattern using jmeter but not able to simulate the situation.
For example, I would like to have threads with constant request per seconds (say, 60 requests per second) running always in the system. Another thread group is responsible for generating seasonal spikes, say each 10 minutes interval, it will generate 120 requests per second for, say, 5 minutes. So, each 10 minutes interval I will have spike which lasts for 5 minutes. Any scripts or suggestions to simulate this situation will be helpful.
As you are already aware, you would need 2 thread groups to achieve this requirement.
Thread Group 1:
You can use Constant Throughput Timer to maintain the throughput 60 requests / second.
This timer introduces variable pauses, calculated to keep the total
throughput (in terms of samples per minute) as close as possible to a
give figure. Of course the throughput will be lower if the server is
not capable of handling it, or if other timers or time-consuming test
elements prevent it.
Thread Group 2:
To create seasonal spike, Ultimate Thread Group might be a good choice or We can also use the regular thread group with Constant Timer to simulate 10 minutes interval & Startup Delay property of the thread Group to give initial delay if any.
To generate load only for 5 minutes, use Runtime Controller.
You would need another Constant Throughput Timer to maintain the throughput of 60 requests / second in this thread group.
Make your Thread Groups to run Forever or select desired duration using "Scheduler" option:
In 1st Thread Group add Constant Throughput Timer and configure it as follows:
Target Throughput: 3600 (60 requests per second * 60 seconds in minute)
Calculate Throughput based on: I believe the best value would be all active threads in current thread group
In 2nd Thread Group add Throughput Shaping Timer and configure it like:
You can use different ramp-up and ramp-down figures, the graph will change to represent your load pattern.
Remember that both timers don't kick off any extra threads so you will have to provide enough threads on Thread Group level in order to create and maintain desired load.
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.
I am novice to Jmeter, and I have certain queries which I am not able to get from the Jmeter home site.
What does throughput value exactly mean - does it mean it is no of requests per second for each thread or it is no of requests cumulatively across threads ?
I want to run a test for 5 minutes evenly spread across 125k requests, how do I specify throughput and delay values assuming no of threads is 60?
The values starttime , endtime, duration, delay, rampup period, etc given in Jmeter file are of seconds/milliseconds ? How can I configure them ?
How can I find the transactions per second value during or after the test ?
As per JMeter Glossary
Throughput is calculated as requests/unit of time. The time is calculated from the start of the first sample to the end of the last sample. This includes any intervals between samples, as it is supposed to represent the load on the server.
The formula is: Throughput = (number of requests) / (total time).
You can set test execution time either using "Scheduler" section of Thread Group where you can set Duration (seconds) for the test. By default JMeter executes samplers as fast as it can however you can use Timers to simulate user think time or add pauses between requests for any other reason. Desired execution rate in "requests per minute" can be set via Constant Throughput Timer
The values are in seconds. Configure them according to your load scenario. As per thread group documentation:
Ramp-up needs to be long enough to avoid too large a work-load at the start of a test, and short enough that the last threads start running before the first ones finish (unless one wants that to happen).
Start with Ramp-up = number of threads and adjust up or down as needed.
The easiest option is using Transactions per Second listener available through JMeter Plugins