0

`I am getting java.net.SocketException: Connection reset while running Jmeter test if the response on the page is exceeding 4 minutes even for the single user. If I run this test (Outside Jmeter) from Browser, it is running file even response is taking 5 minutes. Please help me to resolve this issue. Error logs for quick reference "java.net.SocketException: Connection reset" "at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:313)" "at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:340)" "at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:789)" "at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1025)" "at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:483)" "at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:477)" "at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)" "at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1461)" "at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1066)" "at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)" "at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)" "at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)" "at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)" "at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)" "at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)" "at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)" "at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)" "at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)" "at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)" "at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)" "at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)" "at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)" "at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)" "at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)" "at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)" "at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:939)" "at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:650)" "at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)" "at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1301)" "at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1290)" "at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651)" "at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570)" "at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501)" "at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)" "at java.base/java.lang.Thread.run(Thread.java:1623)"

I have tried multiple options by changing below properties but no luck. In user.properties file: "http.connection.stalecheck$Boolean=true", "httpclient4.retrycount=1", "hc.parameters.file=hc.parameters", "httpclient4.time_to_live=600000"

In Jmeter properties file: "https.default.protocol=TLSv1.2", "https.socket.protocols=TLSv1.2", "https.use.cached.ssl.context=true", "server.rmi.ssl.disable=true", "hc.parameters.file=hc.parameters", "http.connection.stalecheck$Boolean=true", "httpclient4.retrycount=1", "httpclient4.time_to_live=600000"

HTTP Request Defaults: "Implementation = HttpClient4", "Timeouts (milliseconds): Connect: 600000 & Response: 600000"

1 Answer 1

0

I would recommend using a sniffer tool like Wireshark or Fiddler and compare the requests from JMeter and from the real browser, this way you will be able to figure out the differences and who's really resetting the connection.

Make sure to configure JMeter to behave like a real browser, it should be sufficient. If you will make the same request including URL, body and headers as the real browser does - you should get the same behaviour/response.

With regards to your configuration:

  1. All amendments need to be done in user.properties file, the values there override the values in jmeter.properties file and any defaults
  2. http.connection.stalecheck should go to hc.parameters file
  3. There is also httpclient4.idletimeout property which you may want to play with

Be informed that all these overrides are workarounds and should be applied only if you're absolutely sure that:

  1. Server behaves as expected functionally
  2. JMeter is configured to behave like a real browser with 100% accuracy

More information: Connection Reset since JMeter 2.10 ?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.