So to explain my situation:
I have a JMeter test plan that runs some test groups constantly in a loop. In addition to this I need to have multiple sampler requests go through together each minute (to simulate spiked usages). I can't set a constant timer to delay each of these because some may finish up quicker than others and they won't be in sync.
Is there a way to make multiple test groups send a request every minute the test is running?
OR
Is there a way to put all these samplers in 1 thread group and make them all run concurrently?
As far as I'm able to understand your use case, you need 2 Thread Groups.
First Thread Group which is SOAP Sampler A
Second Thread Group which is SOAP Sampler B
Then you need to set different variables for both thread groups to make them behave according to your use case and implement spikes you need.
Important: make sure that "Run Thread Groups consecutively" under your test plan is UNCHECKED elsewise you'll be having SOAP Sampler B running after SOAP Sampler A, not in the same time.
Lets consider your scenario is,
5 Users hitting 5 URLs(samplers) simultaneously.
So what you need to do is, in your Test Plan, add 5 Thread Groups. In each Thread Group configure the number of Threads to 5 and Ramp Up to 0.
Now, add one HTTP Request sampler in each Thread Group. Configure each sampler according to the URL you want to test.
Add Listener(s) to your Test Plan. Save the Test Plan and Run your test.
Make sure you haven't selected the "Run Thread Groups consecutively" in the Test Plan.
Related
I have load testing scenario where test-plan has multiple thread-group and each thread-group has different type of HTTP request and this group is designed to executed in sequence .
Below is scenario I'm testing -
Test-Plan
+---Thread-Group(Register-Request)
+---Thread-Group(Container-Request)
+---Thread-Group(Subscription-Request)
+---Thread-Group(Data-Request)
+---Thread-Group(Deregister-Request)
Load testing has to follow the defined sequence. Each user-thread reads thread specific values from CSV file and during testing, JMeter output shows that:
User-threads don't move from Thread-Group(Register-Request) to Thread-Group(Container-Request) until all user threads have completed execution which looks odd to me.
Any idea what could the reason of this behaviour ?
User threads don't "move" from one Thread Group to another Thread Group, each Thread Group has its own pool of virtual users and they're not connected by any means.
So if you want each user to execute some actions (Register-Request, Container-Request, etc.) sequentially - you need to put the relevant Samplers under the same Thread Group.
If your workload model is more complex and i.e. you need to run different scenarios with different throughputs and maintain user session across Thread Groups at the same time - you can take a look at i.e. Using JMeter Variables With Multiple Thread Groups article Inter-Thread Communication Plugin or
I am trying to build a test plan in JMeter based on a specific thread time series.
For example, I know that at time x, there are n(x) users, and at time x+t, there are n(x+t) users, and so on. The issue is that the number of users has to be updated for t ~= 500ms, and the thread number is in a range of 20 - 200.
Also, ideally, I would like to add and remove threads for the next time slot from the active threads instead of building new threads every time to save resources.
I was trying different tricks to simulate this scenario:
Using execution of Thread Groups sequentially, you can set the duration lifetime but in seconds, every thread will be killed after the specific time slot and recreated in the following thread group.
Using the ultimate thread group, you can define your series of threads for each time interval but still in seconds, and it goes to generate new threads for each timeslot.
In both cases, if you fill the duration box with a value of 0.5, it seems not to recognize it or not work fine.
Do you have any suggestions on how to implement this scenario?
I'm not aware of any Thread Group which has milliseconds precision, but you can try to extrapolate it, for example if you need to add 100 users in 500 ms you can try kicking off 200 users in 1 second and it should be more or less desired load pattern.
The only implementation of thread pool pattern I'm aware of is Throughput Shaping Timer in combination with the Concurrency Thread Group via Feedback Function
And last but not the least there is a possibility to start new threads and stop running ones from JSR223 Test Elements like:
ctx.getThreadGroup().addNewThread(0, ctx.getEngine()) // starts new thread and returns its instance
ctx.getThreadGroup().stopThread('name of the thread', false) // stops the given thread, 2nd argument is for force stop
I tried to test how many limits of VUs that my pc can handle. So far i tried to run with 5000 VUs with GUI mode, its working fine so wondering if this is really the correct way to do it. Here's my laptop specification:
16GB DDR4, 512GB SSD, i5 7th gen
For now I already test with 6 HTTP requests, thread group information as below:
Can anyone verify whether im doing correct way to test the limit? And why does when the test is running, the number of user run at top right is still 47? But at the end of the test, it really shows that it ends with 5000 VUs in the summary report listener (Please refer Jmeter logs in the first screenshot)
You have only 1 loop and 120 seconds ramp-up in the Thread Group so JMeter starts 41 users each second. Once started user starts executing Samplers upside down and when the last sampler is done the thread is being shut down.
So you're running into the situation when some threads have already finished their job and ended and some haven't been yet started. If you want to reach 5000 users then you need to tick Infinite next to Loop Count and specify Thread Lifetime to be greater than your ramp-up time.
More information: JMeter Test Results: Why the Actual Users Number is Lower than Expected
According to JMeter Best Practices you should:
Run your test in command-line non-GUI mode
Disable or delete all the Listeners as they don't add any value, just consume the resources
Once your non-GUI test execution is finished you can either open the .jtl results file using a Listener of your choice or generate HTML Reporting Dashboard out of it and analyze the results
I am new in Jmeter , I am familiar with LR. But not able to get some functionalities in jmeter for "VUser/Thread Group ".
While I am running my script with 10 threads in jmeter , what does that mean () :-
all 10 users are performing same action at same time
or
each thread is performing separate actions
or
once one thread complete then another thread will start its execution.
How to put 'Rendezvous' function in jmeter for some particular transaction or action like we used write lr_rendezvous("R1"); in Loadrunner to hit all vusers at same time. Is that possible in Jmeter then how ?
If you set number of thread as 10 its loadrunner equalent as executing with 10 virtual users. all threads will start executing at same time.
You can use Synchronizing_Timer for achieving Rendezvous in JMeter
http://jmeter.apache.org/usermanual/component_reference.html#Synchronizing_Timer
https://blazemeter.com/blog/using-jmeter-synchronizing-timer
Concerning the 1st part,
'running script with 10 threads' means that they would all start running at the same time... IF ramp-up time == 0.
If you set ramp-up to [someValue] - the threads will get asynced. See the article from jmeter docs.
Each thread will execute the test plan in its entirety and completely independently of other test threads. Multiple threads are used to simulate concurrent connections to your server application.
The ramp-up period tells JMeter how long to take to "ramp-up" to the
full number of threads chosen. If 10 threads are used, and the ramp-up
period is 100 seconds, then JMeter will take 100 seconds to get all 10
threads up and running. Each thread will start 10 (100/10) seconds
after the previous thread was begun. If there are 30 threads and a
ramp-up period of 120 seconds, then each successive thread will be
delayed by 4 seconds.
If you are reproducing human behavior a full rendezvous event, more than one person in the same section of code at the same time engaging in the same function, is exceedingly rare....on the order of a credit card company having only 4-5 people in such an incident on the largest shopping day of the year.
So, if you are headed down this path, consider if you are trying to reproduce human behavior or if you have a technical metric you are hitting with a small number of focused users on such an event.
The use of exceptionally highlighted rendezvous use on a resume is a mark of someone you do not want to hire.
I have 2 thread groups in my test case. Group A should complete first before Group B starts to execute(at least I though this was the way it worked).
Unfortunately they are firing at the same time and tests from both tread groups are executing, what can I do to prevent this from happening. Not to allow group B to start before group A is done executing?
Go to the test plan element and check the box "Run Thread Groups consecutively". This will give you what you want.
http://jmeter.apache.org/usermanual/component_reference.html#Test_Plan