JMeter version - 2.12
I am using JMeter with following thread group configuration -
Number of Threads - 2
Ramp-Up period - 0
Loop Count - Forever checkbox checked
I was expecting tests to run indefinitely since I checked Loop Count 'Forever' checkbox but it stops after 2 thread. Did I miss anything?
I saw your test plan. You have a loop controller which has been set to run only once under the thread group. If you want the test to run indefinitely remove this loop controller.
There could be various reasons:
Have a check on test plan how it has been configured
have a check for resources you are connecting to, in case it is throwing any error
check the error console/jmeter.log file to exactly check what is happening here.
Please ensure to collect as much info as possible as it helps the community as well :)
Related
I am using 'Ultimate thread Group' scenarios for each of my 7 scripts/scenarios (each thread group having different number of users). For each of them, i have given the same 1800s as ramp-up and 3600s for steady-state and 90s for ramp-down.
I expect the test to run for about 1.5 hours whereas it finishes in 55min. Any suggestions please?
Thanks,
N
You can check jmeter.log file, it contains the reason for the ending each and every thread.
I can think of the following possible reasons for premature ending the test and none of them is specific to the Ultimate Thread Group:
You have chosen something other than "Continue" or "Start Next Thread Loop" under "Action to be taken after a Sampler error":
You have CSV Data Set Config which is set up to stop thread at the end of the CSV file and you don't have sufficient amount of test data
You're stopping the tread/test somewhere using Flow Control Action sampler
Your test terminates as the result of an OutOfMemory error
I need to run a load test of 25 threads, what will be the most efficient configuration to use? (ramp-up period....). I ran the load test with the below configuration and some of the threads failed but pass if I just ran the script individually.
Your configuration will mean that:
JMeter start with 1 thread and add another thread each 4 seconds
Once started each thread will begin to execute Samplers upside down (or according to the logic controllers)
When the thread executes the last sampler it will be shut down
When the last thread executes the last sampler the test ends
Depending on the number of samplers and application response time you may or may not achieve 25 users concurrency, you might want to check the actual number of concurrent users using Active Threads Over Time listener
If you want to make sure to have 25 online users set "Loop Count" to Infinite and "Specify Thread Lifetime" duration to be more than your ramp-up period. See JMeter Test Results: Why the Actual Users Number is Lower than Expected article for more details.
With regards to the failures - we cannot state anything meaningful without seeing request and response details, make sure to save them using i.e. View Results Tree listener and inspect response body for the failed requests
I'm executing the JMeter load test with 5 users, 1 hours duration. If my 5 users operations will be completed in below 1 hours, Can it stop automatically. Do we have any option like this?
Just untick this Specify Thread lifetime box under the Thread Group:
and once last of your 5 threads (users) will finish executing its last Sampler your test will end
You can also untick the Infinite box next to the "Loop Count" and your test will stop after completing all the iterations or after 3600 seconds, whatever comes the first:
See Getting Started with JMeter - A Basic Tutorial for essential information on how to build your first web test plan with JMeter
This is regarding JMeter
I have a thread group where number of threads is 100. I get response for all the 100 requests in say 3 minutes. However when I generate html report from the .jtl file, it still shows around 50 threads as active even after 6 to 7 minutes.
I was expecting that the active threads would also die out once the response is received. Should we kill/release threads or do we have a similar option in JMeter which I am missing. Can someone advise please.
If you have only 1 loop in Thread Group - each thread (virtual user) should be terminated once it finishes execution of all the Samplers, assuming you don't have i.e. Loop Controller or While Controller or Runtime Controller which may (and will) "hold" the threads alive.
Also make sure to follow recommendations from 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article, in particular:
Run your test in non-GUI mode
Remove all the Listeners from the Test plan
If the issue persists - check jmeter.log file and take the thread dump to identify what exactly JMeter threads are doing.
I am have been exploring JMeter for the last couple of days. And I am try to achieve the following:
I am trying to create a load test for a service such that, in the first loop 'n' threads are created and in the second loop 'n+m' threads are created and in the third loop 'n+2m' threads, in the fourth 'n+3m' threads and so on. I did find many solutions here and I tried replicating them, but somehow it is not working for me. The test plan I created looks something like this:
Step 1: Add a user defined variable called USERCOUNT = 0
Step 2: Create a thread group. I have used __intSum to increment USERCOUNT by one and storing the result back in USERCOUNT for future reference.
Ideally what I am expecting here is, in the first loop one thread is created, in second loop 2 thread are created and in the third loop 3 threads are created. So in total there should be 6 thread created. However the results show up something like this:
Not sure if I am missing something silly or my approach itself is completely wrong. Any help from the community would be appreciated. :)
I believe what you are trying to do is impossible. When JMeter starts a thread group for the first time it initializes the number of threads.
What you are essentially trying to do is re-run the same test three times with different numbers of users each time. JMeter cannot re-run a thread group once started, it can only re-run ("loop") a thread in a thread group. It is not possible to add threads to a running thread group once the ramp up and threads are initialized. (Let me know if I should try to explain that further).
If you want one thread group to populate the run-time settings of another thread group, you must have two thread groups in the test plan. At the test plan level, check off the option "Run Thread Groups Sequentially."
With that option, JMeter will not initialize the number of threads on the second thread group until the first one finishes. The first thread group can set a global property, and the second thread group can reference it in the number of threads.
How to set a property in beanshell: (this would be in Thread Group 1)
props.put("threadgroup_2_num_users","15");
How to reference that value in Thread Group 2:
${__P(threadgroup_2_num_users)}
If this does not help, maybe try to describe your end goal. What are you trying to learn about the thing you are testing?
Edit: Perhaps using the plugin package "Stepping Thread Group" will allow you to achieve the scenario you are trying in a single thread group. Check this out:
http://jmeter-plugins.org/wiki/SteppingThreadGroup/
JMeter currently doesn't provide possibility to change number of threads on-the-fly during test execution so I would suggest to go with the following alternatives:
Use i.e. Ultimate Thread Group available via JMeter Plugins which adds some extra features to JMeter's Thread Group so you will be able to implement your scenario
Consider so called "goal oriented scenario" when load is based on requests per second rather than on number of virtual users. You can precisely set desired throughput rate and even change it during test run using Constant Throughput Timer