Jmeter thread groups - jmeter

I have entered 500 to be the number of thread group and ramp up time to be 120 seconds but when the report is generated,the virtual users count is only 15 or in composite graph-active threads over time is raised to near about 12. So I am bit confuse active threads counts. Because the data(threads) or numbers that I filled in test plan before test is different and after result is different. What about scaled values in graph?and x10?Something related to threads?

Each JMeter thread representing a virtual user after initialization starts executing samplers upside down (or according to the Logic Controllers).
If thread doesn't have more samplers to execute and no more loops to iterate it's being shut down. It looks just like your case. See Max Users is Lower than Expected article for more detailed explanation and workaround.
Usually people set Loop Count to "Forever" and use Runtime Controller to so test could finish in designed time. Another option is using i.e. Ultimate Thread Group available via JMeter Plugins which provides convenient way of defining a load scenario.

Related

Is there a graphical display issue in JMeter Active Threads Over Time chart?

Intro:
Using JMeter 5.4.1, I have generated the HTML dashboard report for a test with 2 Concurrency thread groups, both having the tstFeedback function configured as such ${__tstFeedback(ThroughputShapingTimerOut,1,1000,10)} along with a Throughput Shaping timer which increases the target load by 21 RPS every one minute. The Threads have some sort of synchronization using an InterThreadCommunication plugin because I need to pass information from one thread to the other.
Issue description:
One Thread group does not need all the 1000 Threads to generate the specified load because it is faster at a given time so only 22 Threads are active at that point in time, however, the Active Threads Over Time chart displays the line at the same level as the Thread which had 1000 active threads at that time. My expectation was that it should be lower (visually is should be much further apart from the other thread group line). Upon hovering over result, it seems to display the correct number of threads, but the scale on the left side is around the 1000 count.
Here are some screenshots about what I mean:
This seems to me as an issue with the graphical representation of the active threads over time chart. Can someone confirm that my assumption is correct?
No, it's just a chart which visualizes the number of active threads (grpThreads column of the .jtl results file)
You can generate the same chart using MS Excel or equivalent
and/or use Active Threads Over Time listener (can be installed as a part of 3 Basic Graphs bundle using JMeter Plugins Manager)
If you're using inter-thread communication plugin and some threads are "waiting" for the data and not doing anything - they will still be displayed as "active" because in JMeter world "active" means a thread that has been "started", but "active" doesn't necessarily mean that the thread is doing anything as it may "sleep" due to a Timer

Number of execution samples

i am running a simple test with 10 users for 5 mins. my test has a single thread and different transactions within it. By the end of the test, there is a different number of samples for each transaction. Is there a way or a setting so that we don't start any new thread when the test is finishing, i tried ultimate thread group plugin with ramp down , hoping to see same samples for all requests but it didn't happen. Not sure if that is even possible.
Each JMeter thread (virtual user) executes Samplers upside down (or according to the Logic Controllers)
When you're defining test duration it might be the case that some virtual users are somewhere in the "middle" of the Samplers and they stop when they receive shutdown signal.
It means that the very first sampler will be executed with 100% of users and for further samplers the chance of getting executed becomes lower and lower.
The only way to have the same number of Sample Results for all Samplers is using normal JMeter Thread Group and providing fixed amount of loops.
Given above setup you will have strictly 80 executions of each and every Sampler in the Test Plan
More information: Getting Started with JMeter - A Basic Tutorial

How does multiple thread groups execute in jmeter

Lets say we have 2 thread groups, one has 10 threads, another one has 30 threads. I have unchecked "run thread group consecutively". In table results, we see response time of second thread group is more than first threadgroup users.
When threadgroups are arranged other way, it shows reverse. So, whichever is second thread group, its user showing response time more than what is there in first thread group.
When you unchecked the "run thread group consecutively", then both the thread group runs in parallel. Now, based on the number of thread they will send the requests. In your scenario, 2nd thread group has created 30 threads and start sending the request. Now, based on,after how much time the response will come, it is listed in the view result. So, you thread group have more thread and may be getting response faster then thread 1. But, thread 1 is also going to be listed in the view results as shown below;-
Option is unchecked, so parallel running:-
So,in short, if "run thread group consecutively" option is unchecked, thread groups will run in parallel else sequential.
Option is checked, so sequential running:-
Hope this helps.
Only one explanation comes to my mind:
You're running your test in GUI mode
You're running it in GUI mode with Listeners enabled
If above assumptions are correct JMeter is simply lacking resources in order to kick off that many threads and given JMeter is not capable of sending requests fast enough you're getting "false negative" results as JMeter spends time in GC trying to free up some Heap space in order to be able to operate.
So:
Make sure to run your test in command-line non-GUI mode
Disable all the Listeners, they don't add any value, only consume valuable resources
Follow recommendations from the 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure in order to configure JMeter for maximum performance

load test with varying number of threads in JMeter

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

JMeter Thread Communication Pre and Post Process delay

My Test Plan have 3 Scenarios,
Submit Quote
Check Status
If Status Complete get Quote Details.
If I keep all these 3 scenarios in one thread then CTT is not putting constant throughput, when I remove create 2 thread 1 for Submit and other for Status and Get Details I am able to maintain CTT, but my 2nd and 3rd Scenario volume drops almost 50%. As I have dependency on 1st step I am using Thread communication and not sure how I can either get CTT in one thread or get same volume from 2 different threads.
Constant Throughput Timer is useful to shape the load where there is > 1 test iteration. If your thread group has only one iteration consider using Throughput Shaping Timer instead or play with ramp-up and thread number values. It is recommended to have only one instance of the CTT in your Test Plan as it's rather resource consuming by nature.
If your scenario assumes different throughput for different thread groups you can add a CTT per Thread Group (make sure that you select All active threads in current thread group (shared) in "Calculate Throughput based on" dropdown
If ITC test elements are throttling your test below desired throughput value consider using
__setProperty()
__property()
__threadNum()
functions to implement inter-thread communication instead. JMeter Properties are global, can be accessed from different thread groups and persist all the time while JMeter is running.
See How to use JMeter's Throughput Constant Timer for details.
If above information is not enough try to elaborate your query and include i.e. thread numbers, target throughput and what kind of information needs to be shared across thread groups.

Resources