1

Good morning colleagues.

I have jmeter test scenario I must run on my back-end service. If I use 1 or ~50 Threads(users) in one time there is no problem. But when I try to set more than 50 users I got an errors like this :

java.net.SocketException: Connection reset

How can I fix it ?

jMeter version 4.0

java 10.0.1

OS Windows 10 64

Full Log :

java.net.SocketException: Connection reset at java.base/java.net.SocketInputStream.read(Unknown Source) at java.base/java.net.SocketInputStream.read(Unknown Source) at java.base/sun.security.ssl.SSLSocketInputRecord.read(Unknown Source) at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(Unknown Source) at java.base/sun.security.ssl.SSLSocketImpl.bytesInCompletePacket(Unknown Source) at java.base/sun.security.ssl.AppInputStream.read(Unknown Source) at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:161) at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82) at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:278) 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.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:286) at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:257) at org.apache.jmeter.protocol.http.sampler.hc.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:199) at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.receiveResponseHeader(MeasuringConnectionManager.java:212) 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.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:684) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486) at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:697) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:455) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178) at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490) at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250) at com.blazemeter.jmeter.controller.JMeterThreadParallel.run(JMeterThreadParallel.java:61) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)

Thanks.

  • What JMeter, java and OS version do you use? Could you attach jmeter full log? – Vadim Yangunaev Feb 14 at 9:55
  • @VadimYangunaev updated question – Сергей Feb 14 at 10:37
  • and the same issue with JMeter 5.0? – Vadim Yangunaev Feb 14 at 11:35
  • @VadimYangunaev You think jMeter 5 will be better than 4 ? ok I'll try. – Сергей Feb 14 at 11:54
  • @VadimYangunaev the problem is still here. first I got 500 Code from Back-end and than Connection reset message. may be Back-end cannot open new Connections ? – Сергей Feb 14 at 12:27
2

Looks like this is an issue with application under test and it does not configured properly to handle this load.
Check:

  1. Application server logs.
  2. Open your application in the browser, while it under the load testing - does it work properly?
  • 1. - did you mean Access Log Sampler ? 2 - which browser you are talking about ? – Сергей Feb 14 at 11:09
  • 2
    No, I mean it does not looks like JMeter issue, but the application. Because if for 50 threads it works ok. 1. So, any kind of logs from your service. Do you have access to them? And what kind of back end service is it? 2. And any case to get responsce from your service outside of JMeter. – Vadim Yangunaev Feb 14 at 11:17
  • I test REST service and Requests, which failed with "Connection reset" message are never write to log. – Сергей Feb 14 at 11:22
  • 1
    What is your application server where you host REST service? – Vadim Yangunaev Feb 14 at 12:42
2

Please implement the below steps, your "Connection reset" problem will be resolved.

  • Change "Implementation" of all your HTTP Request samplers to HttpClient4. The easiest way of doing it is using HTTP Request Defaults configuration element.

  • Please add the following properties in user.properties file which located under /bin folder of your JMeter installation:

httpclient4.retrycount=1
hc.parameters.file=hc.parameters

  • Add the next line to hc.parameters file (same location, JMeter's /bin folder)

http.connection.stalecheck$Boolean=true

  • Please restart your JMeter
  • unfortunately, it doesn't help. I still got Connection reset messages after restarting jMeter. – Сергей Feb 14 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.