I run the load test in JMeter and i got this error.
Non HTTP response code: javax.net.ssl.SSLException/Non HTTP response message: java.net.SocketException: Unrecognized Windows Sockets error: 0: recv failed
why this kind of error i got??
Can it be the case your system has both IPv4 and IPv6 enabled? If so you may run into situation when the request is being written in one thread and response comes in another hence it's "unrecognized"
So either choose one of network protocols in the operating system level and disable the other or limit JMeter to use only IPv4 by adding the next line to it's startup script:
jmeter -Djava.net.preferIPv4Stack=true -n -t test.jmx .....
if it helps you can make the change permanent by adding the next line to system.properties file (lives in "bin" folder of your JMeter installation):
java.net.preferIPv4Stack=true
More information:
Configuring JMeter
Overriding Properties Via The Command Line
Apache JMeter Properties Customization Guide
Related
I am running only 1 request, the request is working good in other machines but my Jmeter is returning
Response code: Non HTTP response code: javax.net.ssl.SSLException
javax.net.ssl.SSLException: java.net.SocketException: Connection reset
I have tried in both versions: 4.2 and 5.3
The reasons could be numerous, we need to know more in order to be able to come up with the comprehensive solution. The same machines in terms of operating system/networking setup with the same Java version should behave the same way.
What you could try is:
Enabling Java Network debugging by adding javax.net.debug=all line to system.properties file (lives in "bin" folder of your JMeter installation
Enabling JMeter Network debugging by adding <Logger name="org.apache.http" level="debug" /> to log4j2.xml file (the same location, JMeter's "bin" folder)
Upon JMeter restart you will be able to see much more troubleshooting information in jmeter.log file and in stdout, compare the output from your machine with one of the machines where the test succeeds, it should give you some insights.
I'm unable to open JMeter in 'Server Mode'. I have followed the following steps.
Steps to reproduce:
Open cmd
To open JMeter in server mode, run the bat file bin\jmeter-server.bat.
Expected Result: JMeter should start in server mode.
Actual Result:
Problem URL:
... Trying JMETER_HOME=..
Found ApacheJMeter_core.jar
Sep 12, 2018 1:33:34 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Server failed to start: java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find the file specified)
An error occurred: Listen failed on port: 0; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find the file specified)
errorlevel=1
Press any key to continue . . .
C:\Users\rozeena.ibrahim>d:
D:\>cd apache-jmeter-4.0
D:\apache-jmeter-4.0>cd bin
D:\apache-jmeter-4.0\bin>jmeter-server.bat
Could not find ApacheJmeter_core.jar ...
... Trying JMETER_HOME=..
Found ApacheJMeter_core.jar
Sep 12, 2018 1:34:12 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Server failed to start: java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find the file specified)
An error occurred: Listen failed on port: 0; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find the file specified)
errorlevel=1
Press any key to continue . . .
This is not a bug, since JMeter 4.0 communication between master and slaves is secure (maybe to prevent possible intruders from intercepting JMeter .jtl result file and dying of laughter seeing your system performance metrics) so you need to generate the keystore using create-rmi-keystore.bat first on master and all the slaves.
Alternatively you can disable this piece of functionality and revert back to previous JMeter behaviour by adding the next line to user.properties file:
server.rmi.ssl.disable=true
it needs to be done on all machines
JMeter restart will be required to pick the property up
the change will be permanent, if you want to do it only once - it is better to pass the property via -J command-line argument like:
jmeter-server.bat -Jserver.rmi.ssl.disable=true
More information:
Remote hosts and RMI configuration
Configuring JMeter
Overriding Properties Via The Command Line
JMeter Distributed Testing with Docker
If you just want to run jmeter in NON GUI mode then do this:
jmeter -n -t jmxplan -l results.csv
But if you really want to use distributed testing, then since JMeter 4.0 the default transport mechanism for RMI will use SSL.
SSL needs keys and certificates to work. You will have to create those keys yourself.
You must create the rmi_keystore.jks as per error message.
JMeter comes with a script to generate a keystore that contains one key (and its corresponding certificate) named rmi.
The script is located in the bin directory and is available for Windows systems (called bin/create-rmi-keystore.bat) and Unix like systems (called bin/create-rmi-keystore.sh).
It will generate a key-pair, that is valid for seven days, with a default passphrase of value 'changeit'. It is advised to call it from inside the bin directory.
See:
https://jmeter.apache.org/usermanual/remote-test.html#setup_ssl
Note that disabling SSL mode would be a security issue, so although possible it is not advised
I am trying to launch my jmeter tests in a remote machine as i will be running bulk users on a .jmx file (Approx 200 000 threads). I have a remote machine where i have downloaded jmeter and saved the folder in desktop. and in command prompt i have a command
Desktop\apache-jmeter-4.0\bin>jmeter-server -n
Could not find ApacheJmeter_core.jar ...
... Trying JMETER_HOME=..
Found ApacheJMeter_core.jar
Created remote object: <Have a message saying the server is up and running>
Now in jenkins i have a command
export JAVA_HOME=/java/1.8.0.65
bin//jmeter -n -R <Remote HOst IP> -t file.jmx -l result.jtl -e -o/resultfolder
When i trigger the job in jenkins i am getting
Configuring remote engine: <Remote machine IP>
Exception creating connection to: <Remote machine IP>; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory)
Failed to configure <Remote machine IP>
Stopping remote engines
Remote engines have been stopped
Error in NonGUIDriver java.lang.RuntimeException: Following remote engines could not be configured:<Remote machine IP>
I have a rmi keystore file created in remote machine.
You need to launch create-rmi-keystore.sh script on all machines and make sure that the configuration is the same, this way communication between JMeter master and slaves will be secure.
More information: Remote Testing: Setting Up SSL
If you don't want the communication between the master and slaves to be secure - you can amend the command line to:
jmeter -Jserver.rmi.ssl.disable=true -n -R <Remote HOst IP> -t file.jmx -l result.jtl -e -o/resultfolder
or add the next line to user.properties file on all hosts to make the change permanent:
server.rmi.ssl.disable=true
JMeter restart will be required to pick the property up. See Configuring JMeter user manual chapter for more information.
Depending on your test nature 1 slave might be not enough to simulate 200k threads so make sure you're following recommendations from the 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article and keeping an eye on JMeter engines health using built-in OS tools or JMeter PerfMon Plugin as if JMeter will not be able to send requests fast enough - you will get lower throughput/higher response times even if your application is not overloaded.
I am getting Assertion Failed error while running jmeter script But I have not used assertions in my script.
I was doing Load testing with 500 users and getting Assertion Failure errors
Most probably your script fails to download at least one so called "embedded resources" - image, script, style, font, etc. If you are not interested in the problems with the embedded resources - you can turn JMeter automatic check for HTTP Status code < 400 by adding the next line to user.properties file:
httpsampler.ignore_failed_embedded_resources=true
JMeter restart will be required to pick the property up.
If you don't want the change to be permanent you can pass it on ad-hoc basis using -J command-line argument like:
jmeter -Jhttpsampler.ignore_failed_embedded_resources=true -n -t test.jmx -l result.jtl
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide
JMeter Properties Reference: Miscellaneous configuration
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