JMeter - Unable to stop / shutdown - jmeter

I have a very simple test plan in JMeter. There is just one thread group with one get request. ( I created this to isolate an issue which I faced in another real world test plan)
I was trying to increase the load and analyse the result.
While reaching a point, say 5000 users, JMeter does not stop.
I was unable to manually stop or shutdown. While trying to do so, the following message is displayed. But there is no response after that even though I waited.
It says you can see the active number of threads in the upper right hand side, but I can see that there are no active threads.
If I go to task manager to end the task, the same pop up message is displayed in JMeter and hence I am not able to end the task.
Please can someone advise on why I am getting this message when I could not see active threads in JMeter UI.

You're violating one of the most important JMeter best practices: GUI mode is only for tests development and/or debugging
If you want to execute your load test with 5000 virtual users you should be running JMeter in command-line non-GUI mode like:
jmeter -n -t /path/to/your/test.jmx -l /path/to/result.jtl
Once your test finishes you can open the result.jtl file with the Listener of your choice or generate HTML Reporting Dashboard from it

Related

Jmeter CLI stops tests after sometime. Any ideas?

When I run Jmeter from Windows CLI, after some random time, the tests are being stopped or stuck. I can click on ctrl+C (one time) just to refresh the run but part of the request will be lost during the time it was stuck.
Take a look at jmeter.log file, normally it should be possible to figure out what's wrong by looking at messages there. If you don't see any suspicious entries there - you can increase JMeter's logging verbosity by changing values in logj2.xml file or via -L command-line parameters.
Take a thread dump and see what exactly threads are doing when they're "stuck"
If you're using HTTP Request samplers be aware that JMeter will wait for the result forever and if the application fails to respond at all - your test will never end so you need to set reasonable timeouts.
Make sure to follow JMeter Best Practices
Take a look at resources consumption like CPU, RAM, etc. - if your machine is overloaded and cannot conduct the required load you will need to switch to distributed testing
There are several approaches to debugging a JMeter test which can be combined as a general systematic approach that I capable of diagnosing most problems.
The first thing that I would suggest is running the test within the JMeter GUI to visualize the test execution. For this you may want to add a View Results Tree listener which will provide you with real time results from each request generated:
Another way you can monitor your test execution in real time within the JMeter GUI is with the Log Viewer. If any exceptions are encountered during your test execution you will see detailed output in this window. This can be found under the Options menu:
Beyond this, JMeter records output files which are often very useful in debugging you load tests. Both the .log file and the .jtl file will provide a time stamped history of every action your test performs. From there you can likely track down the offending request or error if your test unexpectedly hangs:
If you do decide to move your test into the cloud using a service that hosts your test, you may be able to ascertain more information through that platform. Here is a comprehensive example on how to debug JMeter load tests that covers the above approaches as well as more advanced concepts. Using a cloud load test provider can provide your test will additional network and machine resources beyond what your local machine can, if the problem is related to a performance bottleneck.

How to avoid Jmeter's error after pausing the stress test

I am now using Jmeter to run the stress test on APIs. When I stopped the test manually by pressing the stop button, Jmeter would return "socket closed exception error".
Therefore, I would like to ask is there any way so that this error will not occur in my reports?
Thanks very much.
Don't use GUI for running the test, it's only for tests development and debugging, you're supposed to run your JMeter test using command-line non-GUI mode.
No matter of the way of execution forcefully stopping the test will result in non-graceful connections termination, you should rather set fixed number of iterations and/or duration in the Thread Group and wait for the test completion
If you really need to manually stop the test you can use shutdown.cmd script (lives in "bin" folder of your JMeter installation
And finally you can remove "unwanted" results i.e. in last X seconds of the test using Filter Results Tool

Jmeter How to stop the execution of all threads when find error in thread

I am new to Jmeter
I just wanted to stop the execution of all threads when find error in any of the threads.
I gone through many blogs and I used Action to be taken after Sampler error as Stop Thread and Stop thread etc.
Still I didn't see threads getting stopped in Jmeter GUI.
What to use if I want to see thread stopping when find any error while running threads.
Eg
Threads :500
Rampup: 5 Sec
If thread fail at 450 thread then I should see
#samples as 450 amd error % as 0.01(or something )in Summary report.
Is it possible?
It is possible only if you run your test with 1 thread, when you have more than one thread you will run into the situation when there are several threads online executing Samplers and when the error occurs JMeter will either ask threads to stop or tell them to stop resulting in more sample results than you expect.
Also according to JMeter Best Practices you're not supposed to be running your test in GUI mode, it's only for tests development and debugging, when it comes to test execution you need to run your JMeter tests in command-line non-GUI mode like:
jmeter -n -t test.jmx -l result.jtl
However it doesn't explain the results you're getting, I wouldn't expect exactly 1000 sample results given your configuration so if you want to get to the bottom of the issue you will need update your question with test plan overview, .jtl file and jmeter.log file contents.

Jmeter load test is not getting over at given time

I'm running Jmeter load test from command prompt for about one hour and test is not ending at one hour. It is taking more time that one hour.
I'm getting errors in Jmeter logs for failed transactions:
Non HTTP response code: java.net.SocketException
Non HTTP response message: Unexpected end of file from server
Please advise. Is it because of some threads is hanging and how to rectify it.
Thank you
Most probably you didn't set Connect and Read Timeout in Http Request default.
So if you server hangs, JMeter will wait infinitely for the response.
Beside ensure you set correct values in your scheduler.
If issue persists, please give more details with screenshot.
By default JMeter "asks" threads to stop and waits for their graceful shutdown. If threads cannot be stopped in a timely fashion you have the following options:
Implement a "hard stop", i.e. instead of "asking" threads to stop you need to "tell" them to stop. It can be done using i.e. Test Action sampler with Stop now action. (remember that in this case JMeter won't wait for graceful shutdown and you will get extra errors connected with abnormal threads termination)
The fact that JMeter threads are stuck may indicate problem with your application so I would recommend checking baseline health metrics on the application under test side using i.e. JMeter PerfMon Plugin. If there is enough headroom but it still works slowly or doesn't work at all it might indicate a bottleneck in your application code or infrastructure.
Also make sure you are following JMeter Best Practices and make sure your JMeter load generator(s) have enough CPU, RAM, etc. as in some cases JMeter can report "false negative" results due to lack of hardware resources.

JMeter Stops sending HTTP requests

I am using JMeter for load testing. I have simulate 1500 users with loop count 1. But JMeter stops sending request after 1388 users. I wait for 3 hour but user didn't get increase.
also i am able to access the site under test from another system when JMeter stops sending request, it means server is not under load.
First of all, run JMeter in non-GUI mode as
jmeter -n -t /path/to/your/testplan.jmx -l /path/to/testresults.jtl
Second: disable all the listeners during test run. After test execution completion you will be able to open testresults.jtl file with the listener of your choice and perform analysis
Third: follow recommendations from JMeter Performance and Tuning Tips fuide
Finally: if you will be still experiencing problems it means that you went above your load generator machine hardware limits and need an another machine(s) to run JMeter in distributed mode.

Resources