I have created a test plan with multiple thread groups that I want to execute simultaneously.
One group (A) involves tagging a folder with 1000 images in it, so it takes approx 10 seconds to respond.
The other group (B) is real quick.
What I've found is that group B seems to "stick" and wait for thread A to complete. Now all the reading I've done says that thread groups should be totally independant, but this doesn't seem to be the case in my test plan.
I have an HTTP defaults manager, cookie manager and user defined variables that are shared between groups (but have tried adding them in the separate thread groups).
Anyone got any idea why this should be?
Script is here: https://www.dropbox.com/sh/fhdof4ynjt73s2p/mkrphWcfHK
(likely will not run or stick though as this uses internal URL's)
This issue is not in JMeter, it is the application that is locking.
Looking at your test, you seem to use one user to do your load test, this clearly explains your issue and makes your test unrealistic as you have around 20 Users logged with the same user/password.
Related
I'm relatively new to Jmeter but I have a scenario that I've not been able to figure out where I need to perform the following:
All user log in to application with a ramp-up period of 15 seconds between users.
No activity continues until all users log in to application.
Once all users are logged in, perform their set of business activities (will vary depending on business process, and based on iterations, not a time loop).
Once all users are complete business processes, users begin to logout with ramp-down time of 15 seconds between users.
Is this possible to configure my script to execute this way and if so, how? I have tried use of Once only controllers, loop controllers, constant timers, and some various plugins (Custom Thread Groups). I've also viewed various threads and not been able to find this exact scenario, but cannot imagine this is an overly unique test case...
Any recommendations or advice is appreciated.
Thanks!
This is highlighted in question above
Ramp-up period can be easily configured using "normal" Thread Group
To "wait" until all the users are logged in use Synchronizing Timer
Use Loop Controller to run the "business activities" as many times a you want
The same to wait until all the users finish executing their "business activities"
To implement ramp-down you can use JSR223 Timer and the following code:
return (ctx.getThreadNum() + 1) * 15000
where ctx stands for JMeterContext, see JavaDoc for all available functions and Top 8 JMeter Java Classes You Should Be Using with Groovy for more information on this and other JMeter API shorthands available for the JSR223 Test Elements.
The stress test plan contains 5 threads, see below.
Lets consider a food booking app :
Thread 0 contains the prerequisites such as extracting the token which will be used by the remaining threads (1,2,3,4).
Thread 1 relates to the food menu.
Thread 2 relates to adding items to the menu and calculating the order price.
Thread 3 creates the order.
Thread 4 confirms the order.
Each thread requires the previous thread to be executed as it uses the response from the previous thread and I have been asked to run Thread 1,2,3,4 concurrently, but the fact is they cannot be run concurrently as
Thread 3 cannot be executed without actually executing Thread 2 and so on.
7.
Let me add a real-world use case:
A user is viewing the menu items
Concurrently, another user is confirming the order
Another user is adding items to the cart
Actually, all the operations are taking place concurrently, but no operation can be performed by skipping the previous threads.
How do I make changes to my script to accommodate such type of parallel stress testing?
Had to re-read your question a few times... I think what you are asking is can you run multiple "Thread Groups" ... the answer is yes, in your test plan you right-click and add multiple Thread Groups, each thread Group has its own user journey scripted.
As for dependencies between Thread Groups there are options for sharing variables. but you would likely need to work out your logic and write a little bit of groovy to ensure that the data flows correctly.
You could also look at "How to Use the Inter-Thread Communication Plugin in JMeter" on the BlazeMeter website: https://www.blazemeter.com/blog/how-to-use-the-inter-thread-communication-plugin-in-jmeter
Update: After Christian's formatting of the question, it appears that "threads 0-4" are describing a user journey. for example; user logs in, clicks menu, adds item x, goes to checkout etc.
This would be recorded in one Thread Group. Each call made would provide a server response that could then be parameterised and correlated, ensuring data is passed appropriately. The "concurrency" would come from ramping up multiple users "Threads".
For example; here in this screenshot, I have added a Thread Group that has 4 HTTP Samplers (the user journey). The Thread Group is then set to run 10 users, ramping up in 5 minutes (300 seconds), and runs for a duration of 3600 seconds (aka 1 hour).
I need to run a jmeter test with N users over the course of a fixed time period. I am planning on using an "Ultimate Thread Group" for this as it meets my requirements. However, at the end of the time period and during the ramp down it simply kills threads even if they are not finished. This causes me problems because I end up in a situation where I have half completed records left lying around. Is there any way, either using this type of thread group or any other type to do as I require?
I have already got my test script ready, and have been exploring different thread groups and UTG seems like the best option, apart from the fact it kills threads without waiting for completion.
I would recommend to use stepping thread instead of ultimate thread group, this will surely help you out with your scenario. You can adjust stepping thread parameters according to your needs.
I'm running a distributed test using 5 JMeter clients (slaves). Each client is set to run 50 users. At the conclusion of the test I generate a series of graphs from the resulting JTL along with a SynthesisReport. The SynthesisReport details 250 samples for each request, as you'd expect, however the TimeVsThreads and the ThreadsStateOverTime peak at 50 users, as if they were showing the results from just one of the clients.
I've confirmed that the jmeter.properties files for each client are the same as I suspected that it was possibly an issue with the each clients results file configuration and settings for saveservice.
I can't imagine this is by design, has anyone experienced something similar and if so how did was it solved?
As per documentation:
http://jmeter-plugins.org/wiki/ActiveThreadsOverTime/
Just name your thread groups using a unique id for each generator ( hostname or a property you pass to injector and use with function __P if you have more than 1 injector per host) and it will work fine.
This is normal for Jmeter Distributed Testing.
The reason this occurs is that each load generator separately starts User Threads 1-50, so when cmdrunner runs, it sees 1 responses from each User Thread 1 (5 total), but can't differentiate between them.
If you're using a custom reporter tool (that wraps cmdrunner), you can multiply your peak users by your load generators to display a more accurate number at the top of your Report. But as long as you're calling cmdrunner, you won't be able to see the actual number of users on your graphs.
This is normal behavior of JMeter. 5 clients will run each 50 threads.
Open JMeter and run on all remote hosts, and check Active threads each will run 50 threads.
I am trying to run http samplers sequentially for multiple requests. Where the output of 1 API response is the input of next API request. My concern is when I run with 5 users (for. e.g), then at given point of time it first executes 1st API with 5 users then second API with 5 users, in this process the API where input is required gets lost. Please help me on this. I need a solution, where all the samplers are first executed for first user, then for second thread all the samplers are executed and so on.
Dzizu is correct, threads are independent so you are going to run into problems with this approach.
Since you are using 5 users across the test, it would be better to have one thread group with 5 users, and then have Simple controllers (or Transaction controllers) that hold the HTTP samplers and whatever else you are using. This will ensure that the samplers are executed concurrently, but they can still share data if required.
Simple example below:
Threads usually are independent. The easiest way in my opinion is to put full process in one thread and then multiply threads in thread groups.
Eventually I tried to solve this by using loop count option. For example if I want to simulate 5 users in 1 second, I set values as loop count=5,threads=1,ramp-up=.2.
This worked for me so give it a try.
Use the Transaction Controller or Simple Controller to group your samplers together and run them in sequence without worrying about the number of threads. For me, it is working as expected :).