Sequential test execution jmeter - jmeter

I want to run 2 day test and I am making use of Thread Group Start time and end time feature.
I am looking for design as shown below :
Thread Group 1 (First day start and end time with date)
--> HTTP Request 1 (Execute for 30 minutes)
--> HTTP Request 2 (Should start after 30 minutes i.e. after first one is terminated)
--> HTTP Request 3 (Should start after 60 minutes i.e. after second one is terminated)
Thread Group 1 (Second day start and end time with date)
--> HTTP Request 1 (Execute for 30 minutes)
--> HTTP Request 2 (Should start after 30 minutes i.e. after first one is terminated)

Thread Group start and end times are absolute, therefore you will be able to execute the test only once without editing it. I would rather recommend sticking to relative times like:
Thread Group, 2 loops
Runtime Controller configured to run for 1800 seconds
HTTP Request 1
Runtime Controller configured to run for 1800 seconds
HTTP Request 2
Runtime Controller configured to run for 1800 seconds
HTTP Request 3
Flow Control Action sampler configured to pause current thread for 86400000 milliseconds (24 hours)

Related

100 requests per minute for a duration of 20 minutes - Load/performance testing

I am doing load test on my system using Jmeter. the requirement is I need to generate 150 requests per minute for a duration of 20 minutes constantly.
I tried with below approaches
I tried by giving this configuration.
No of threads - 3000 [150 req/min * 20 mins]
rampup period - 1200sec [20mins * 60]
But here test stopped after creation of 2004 thread. by giving
this error
Failed to start the native thread for java.lang.Thread “Thread Group 1-2004”
Uncaught Exception java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached in thread Thread[#51,StandardJMeterEngine,6,main]. See log file for details
Used concurrency thread group with below details
Target concurrency - 150
ramp up time - 1 min
hold target rate time - 20 mins
but here no of samples collected are more than 3000 [150 req *20 sec] which i feel is not correct
Is it possible to create exact load according to my requirement in Jmeter(150 req/min ->duration of 20 mins) or should I explore other tools like locust??
tried with precision timers (attaching screen shots)
enter image description here
enter image description here
enter image description here
Your understanding of relationship between users and hits per second is not correct.
When JMeter thread (virtual user) is started it begins executing Samplers as fast as it can. The throughput (number of requests per second) mainly depends on the response time.
For example:
you have 1 user and 1 second response time - the load will be 1 request per second
you have 1 user and 2 seconds response time - the load will be 0.5 requests per second
you have 2 users and 2 seconds response time - the load will be 1 requests per second
you have 4 users and 2 seconds response time - the load will be 2 requests per second
etc.
If you want to slow down JMeter to the desired number of requests per minute it can be done using Timers.
For example:
Constant Throughput Timer:
Precise Throughput Timer:
Throughput Shaping Timer

Jmeter - Until request gets success execute max. 60 requests in 5 minutes with 5 seconds pause

I have one request, which triggers every 5 seconds and maximum for 5 minutes until it gets 200 in response code. So ideally that request executes 12 times in a minute and 60 requests total if it fails everytime.
My problem is how I define those maximum 60 requests.
Here is my configuration
I have taken one While Controller
${__javaScript(parseInt(vars.get("Response_code"))!=200)}
In that while controller this components are there,
While Controller
User Defined Variable (Response_code)
Counter (Starting value: 1, Increment:1, Maximum Value:60)
My HTTP Request
JSR223 PostProcessor (vars.put("Response_code",prev.getResponseCode());)
Constant Throughput Timer (Targer throughput: 12.0)
Where should I have to put condition like if my HTTP request gets success in 3rd attempt go ahead to next request else repeat that request again after 5 seconds till 5 minutes?
I am using jmeter Ver. 5.5
You can amend your While Controller's condition to look like:
${__javaScript((parseInt(vars.get("Response_code"))!=200 && ${counter} < 60),)}
this way it will loop until response code is 200 but not more than 60 times.
Instead of Constant Throughput Timer you can use Flow Control Action sampler to introduce static delay of 5000 ms.
There is no need to have a counter, While Controller exposes a special variable, in your case it will be ${__jm__While Controller For Thumbnail-1 QA1.pdf__idx}
More information: Using the While Controller in JMeter

Duration Based Apache JMeter Scenario

am running test in duration based scenario with jmeter 5.4.1, at the end of the script, test is getting stop prematurely without executing some of the calls in the last iteration, please help me to make sure all the calls executed in the last iteration, i have tried loop,duration controller nothing seems. to be prominent
Example: i have home, login, search,select item & logout, duration of 5 min with 1 user
Test execution : Home 10 login 10 search 9 select item 9 logout 9
Test execution : Home 10
login 10
search 9
select item 9
logout 9
If you set duration in the Thread Group or in Runtime Controller it doesn't guarantee that all Sampler will be executed equal number of times, when the duration is reached or exceeded JMeter will start shutting down the threads (virtual users) and the total number of sample results will mainly depend on the application response time.
So if you want to execute everything 10 times only - set number of loops in the Thread Group to 10 and either increase or remove the duration.
Alternatively you can use Concurrency Thread Group configured like:
this way 1 user will execute samplers for 5 minutes as fast as it can but not more than 10 times.

Can I apply factor when running load tests jmeter

I have the following scenario:
every 1/2 hour a user send a file to the server
every 5 seconds a user pings the server
do it for 4000 users during 24 hours
my question is, can i do the following and achieve the same results?
every 15 minutes a user send a file to the server
every 2.5 seconds a user pings the server
do it for 2000 users during 24 hours
thanks.
Add Thread Group to your Test Plan and configure it to have 4000 virtual users, loop forever and run for 84600 seconds (24 hours * 60 minutes per hour * 60 seconds per minute)
Add a HTTP Request to ping the server
Add Constant Throughput Timer as a child of the HTTP Request sampler and configure it to fire 12 times per minute (60 seconds in minute / 5 seconds)
Amend Calculalte throughput based on dropdown value according to your test scenario (whether each user or any user should ping the server each 5 seconds)
Apply the similar configuration for remaining use cases.

Jmeter - I have run 2 test cases but result seems odd

I have run load testing for website but when I have increased no. of users , I can see throughput time seems increasing instead of decrease.
Test Case 1 :
No. of Threads : 15
Ramp up time : 450 [As I want to put delay of 30 seconds between 2 users]
Loop count : Forever
Scheduler : 1800 Seconds [As I want to run test for 30 minutes]
In Http requests I have added 10 pages and each request has constant timer with 30000 miliseconds as I need to put delay of 30 seconds between 2 requests.
Now When I see result of Aggregate Report , it shows me Throughput 3/min for each request.
Test Case 2 :
No. of Threads : 30
Ramp up time : 900 [As I want to put delay of 30 seconds between 2 users]
Loop count : Forever
Scheduler : 1800 Seconds [As I want to run test for 30 minutes]
In Http requests I have added 10 requests/pages and each request has constant timer with 30000 miliseconds as I need to put delay of 30 seconds between 2 requests.
Now When I see result of Aggregate Report , it shows me Throughput 6/min for each request.
I am confuse that how it is possible? If my users are increased from 15 to 30 then it should have more load on server and throughtput should decrease like 1/min or 2/min.
Please let me know what I am doing wrong here.
Throughput is no. of completions per unit time. (A completion can be a http request/db request in short anything that needs to be executed and needs >0 execution time.)
Ex. req per sec or req per min etc.
By definition of throughput in JMeter, it is calculated as total no. of requests/total time.
In your first case, no. of requests generated in 1800 seconds with 3 second delay in every request by 15 users are x. Thus throughput is x/30 i.e. 3 it means ~90 requests were generated (verify this from aggregate report or other reporter.)
In your second case, everything else is same but no. of users are doubled which creates ~double no. of requests in given time which is (1800 seconds)
Thus according to formula, no. of requests generated/total time.
Throughput in 2nd case = 2x/30 = 2*throughput in 1st case
Which is 6/min. (Correctly shown by JMeter.)
Key here is to check no. of requests generated in both cases.
I hope this clears your confusion. Let me know if you need further clarification. BTW "when I have increased no. of users , I can see throughput time seems increasing instead of decrease." is not always true.
Throughput increased by factor of 2.
Test Case 1: - 3 requests per minute - 1 request each 20 seconds
Test Case 2: - 6 requests per minute - 1 request each 10 seconds
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 may also be interested in the following plugins:
Server Hits Per Second
Transactions Per Second
or alternatively Loadosophia.org service which can convert your JMeter .jtl results files into easy-understandable professional load report

Resources