Jmeter hangs even if resources avaliable - jmeter

Hi I am using Jmeter to 20 parallel HTTP request from (20 treads each threads one request and 1 iteration).
Each request POST JSON of almost 2mb.
I have given Jmeter heap of 30gb still jmeter threads got stuck and no response.
running jmeter in non-gui mode.
Test server is working fine.
any help what could be the issue ?
LoadGenerator system:
jmeter version : 4
OS 64bit
Windows server 2016
RAM 128GB
CPU Intel(R) Xeon(R) CPU E5-2673 v3 #2.40GHZ

JMeter does not need 30 gb Heap to run your use case, it is even worse to do that as you'll face long GC pauses.
So reduce Heap to 4Gb and add on Http Request Defaults element:
Connect Timeout to 5000
Read Timeout to 30000
And see if it still hangs.
If it still hangs double check that you're respecting those best-practices:
https://www.ubik-ingenierie.com/blog/jmeter_performance_tuning_tips/
https://jmeter.apache.org/usermanual/best-practices.html
If it still hangs then make a Thread Dump and add it to your question.

In my case the error was because generting the HTML report in the same command won't work for a lot of concurrent users. What I ended up doing is to first generate a CSV report and then generate a html report in a second command:
java -Xms3048m -Xmx3048m -jar ../../programas/apache-jmeter-5.5/bin/ApacheJMeter.jar -n -t $PWD/tests/mono_user.jmx -l results.csv
java -Xms3048m -Xmx3048m -jar ../../programas/apache-jmeter-5.5/bin/ApacheJMeter.jar -g results.csv -o results

Related

JMeter - Remote Testing on Linux

I am executing JMeter remote testing with 1 master machine (192.168.0.1) and with 7 slave machines with 3 VMs (192.168.0.2 to 192.168.0.4) on a network interface and 4 other VMs (192.168.0.5 to 192.168.0.8) are in a different network interface.
My JMeter script is located at Master machine - 192.168.0.1
I tried to execute my test with the following command
./jmeter -n -t /home/lup01/Document/LuP2021/ITonICE_Lasttest_InfluxDebug_09032021.jmx -l /home/lup01/Document/LuP2021/LuP2021_LastTest_001_14-10-2021_7VMs.jtl -R 192.168.100.2,192.168.100.3,192.168.100.4 -Djava.rmi.server.hostname=192.168.100.6,192.168.100.7,192.168.100.8,192.168.100.9
However, the test never started. the screen just hung and after 15 minutes i had to stop the test. I did the sample run only with 3 threads.
On course of debugging, i also checked that, when i executed the test with
./jmeter -n -t /home/lup01/Document/LuP2021/ITonICE_Lasttest_InfluxDebug_09032021.jmx -l /home/lup01/Document/LuP2021/LuP2021_LastTest_001_14-10-2021_7VMs.jtl -R 192.168.100.2,192.168.100.3,192.168.100.4
the test was running fine with 3 VMs which are on the same interface as the master machine
However, when i executed the 2nd part
./jmeter -n -t /home/lup01/Dokumente/LuP2021/ITonICE_Lasttest_InfluxDebug_09032021.jmx -l /home/lup01/Dokumente/LuP2021/LuP2021_LastTest_001_14-10-2021_7VMs.jtl -Djava.rmi.server.hostname=192.168.100.6,192.168.100.7,192.168.100.8,192.168.100.9
the test got executed but the load was generated only on the master machine (192.168.0.1). i validated this by printing the host name in the result file.
Can someone please guide me what changes i need to do to get the test running successfully and the load being generated at the slave machines 192.168.100.6 to 192.168.100.9?
JMeter Master machine doesn't generate any load, it only reads .jmx script, transfers it to slaves and collects results.
It doesn't make sense to run more than 1 JMeter process on 1 machine, it doesn't provide any benefit and just consumes resources, if you have only one machine - run a single JMeter process, just make sure to follow JMeter Best Practices and properly tune this JMeter instance for high throughput testing
If this is some form of an experiment and you have to run multiple JMeter processes on a single host and would like to bind different JMeter instances to different network interfaces - you can do it via "Advanced" tab of the HTTP Request sampler (or HTTP Request Defaults if you have more than one sampler) like it's described in Using IP Spoofing to Simulate Requests from Different IP Addresses with JMeter

How to create 8 instances with 500 users each using Non-GUI mode in Jmeter

I have a requirement to run 4000 users. I just wanted to run that using Non-GUI. How can we create 8 instances with 500 users each using Non-GUI mode in Jmeter. Suggest the possible scenario with an example.
Get 9 machines somewhere somehow
Install Java 8+ (it's the per-requisite to run JMeter 5.4)
Install JMeter onto all machines. If you plan to use JMeter Plugins make sure that all the plugins are installed on all machines
If your test depends on external files or libraries - make sure that all the libraries and/or files are copied to the JMeter Machines
If you plan to use secure communication between master and slaves follow Setting Up SSL JMeter Documentation chapter, if not - add the next line to user.properties files on all machines:
server.rmi.ssl.disable=true
Run jmeter-server on 8 machines which will be acting as slaves
Add the next line to user.properties on the master machine
remote_hosts=ip_address_of_slave1,ip_address_of_slave_2, etc.
Make sure that the machines are on the same subnet and there is no firewall blocking connections between them
Run your test as:
jmeter -r -n -t /path/to/your/test.jmx -l /path/to/results.jtl
When the test finishes analyze your results by using Listeners or generating HTML Reporting Dashboard
More information:
Remote Testing
How to Perform Distributed Testing in JMeter

JMeter - Error to run shutdown.cmd when test running in Non-GUI mode

I am running the test for API Performance testing for 2000 users in CLI Mode at first. Second round of test with 5000 VUs but the second round the test won't stop. I run for for interval time of 12 minutes but past 12 minutes the test still dont finish the thread by 5000 VUs.
So I want to shutdown the test running. This error occurs when I want to stop the test running (click shutdown.cmd)
I also tried to open the mirror-server.cmd to troubleshoot:
By double clicking these exe file in the JMeter bin folder (I tried to click both but same error).
And suddenly my test is running almost 20k VUs now:
I also already restart my pc and try to run again with 500 VUs, but the number doesn't start with 500 VUs instead, it is starting with 5000 VUs!
Can advise what is the issue here? Is the root cause come from the second round which does not finished the test? Luckily I don't encounter any errors of Out of Memory at the moment. How to force stop all tests that currently running in the command? Please advise, thanks!
These are not .exe files, they are Windows Batch scripts
I cannot reproduce your issue using the steps you provided:
You can try stopping your test by running this shutdown.cmd from the "bin" folder of your JMeter installation from Windows Command Prompt
You can just press Control + C in the shell window where your test is running to stop it
As the last resort you can always use taskkill command to terminate all Java processes
taskkill /f /im "java.exe"
Warning: it will terminate all Java process instances, not only JMeter
The number of active threads is in this column:
It's hard to say why your test is not ending without seeing your test configuration and jmeter.log file preferably with debug logging enabled for the Thread Group and Timer components you're using

check_jvm Nagios plugin to monitor java threads and heap memory not running

I have a Nagios monitoring system to monitor servers. I have a server in which WebSphere portal has been installed. I want to configure a system in which when there is high CPU usage/thread count increases, it automatically takes a thread dump. For this, I am using nagios plugin check_jvm. This plugin uses a jar called JvmInspector.jar. JvmInspector.jar should list all the jvm names which are running in the system.
Usage of JvmInspector.jar is as follows:
java -jar JvmInspector.jar all
When I am running this, it is showing an empty result although I have a running WebSphere portal server running. Inspite of this, I tried to run 'check_jvm' plugin but it shows the following result:
[root#dev03 libexec]# sudo -u root /usr/local/nagios/libexec/check_jvm -n WebSphere_Portal -p threads -w 105 -c 135
UNKNOWN Can't connect to the JVM:
Can anybody help me in this?

What could be the cause for Socket errors reported by JMeter

I am running a test with 350 users at peak. I have split the tests in two machine with one machine running 220 users and rest on the other machine. On both the machines after a few minutes of run I start seeing socket exception, socket time-out exception and HTTP host exception.
I have tried to find any error that correlates to this exception in the load-balancer (software), IIS logs, application logs and environment monitoring system but I have not found them any where.
I read a lot of blogs and answers on SO that have had the same problem and were able to solve it through changing JMeter settings. I have attempted all of these settings but none have helped.
I am running my test on
Windows Server 2012 R2/ 6 GB RAM/ 64 Bit OS/ 64 bit Java/ Intel Xeon CPU E5-46170 # 2.90 GHz processor/ JMeter 2.13
My JMeter.bat setting are:
set HEAP=-Xms1536m -Xmx2048m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=1024m -XX:+UseConcMarkSweepGC
set SURVIVOR=-XX:SurvivorRatio=3 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=12
rem Java 8 remove Permanent generation, don't settings the PermSize
if %current_minor% LEQ "8" (
rem Increase MaxPermSize if you use a lot of Javascript in your Test Plan :
set PERM=-XX:PermSize=64m -XX:MaxPermSize=128m
)
set IPV4=-Djava.net.preferIPv4Stack=true
set ARGS=%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %RMIGC% %PERM% %DDRAW% %IPV4%
My HC.Parameter settings are:
http.connection.stalecheck$Boolean=true
My user.properties settings are:
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.data_type=false
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_data.on_error=false
jmeter.save.saveservice.response_message=false
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.subresults=false
jmeter.save.saveservice.assertions=false
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.hostname=true
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.sample_count=true
jmeter.save.saveservice.response_message=false
jmeter.save.saveservice.assertion_results_failure_message=false
jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss.SSS
jmeter.save.saveservice.default_delimiter=,
jmeter.save.saveservice.print_field_names=true
jmeter.save.saveservice.autoflush=true
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
I am running my test for 2 hours and my test have been set to loop forever, Stop Thread on error (also run using: start next thread loop on error). I have checked Download Embedded resources and have set the connection Pool as 6(also run with 4).
I have run the tests using default HTTP client and HTTPClient 4.
As of now I can think of 3 other things to try but I am pretty much at the end of my wits and could use a few suggestions.
IP Spoofing,
Run with Java Client
Run in Server client mode.
If you need additional information i'll provide as much as I can but please help!
Additional information:
Socket errors I am getting
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$6: I/O exception (java.net.SocketException) caught when processing request: Connection reset
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$6: I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
Directly hitting IIS
I ran some tests by directly hitting one server with Failed request logging turned on and noticed the below errors.
A process serving application pool 'XXXXXXXXX' failed to respond to a ping.
The process was terminated due to an internal error in the .NET Runtime at IP XXXXXXXXXXXXXX with exit code 80131506.
When you load test, it happens very often that application under test cannot handle the load which will manifest as socket rest, socket timeout...
In your case the server is closing the connection, this means it's probably overloaded.
You need to check the components on server side:
Firewall
Load Balancer
Apache or IIS or any other webserver
J2EE server like tomcat or jboss or other similar

Resources