1
votes

Recently I'm working on performance script which will test 3rd party service.

Test is very simple, each thread need to POST one request. Number of Threads - 100, Ramp Up - 680 s

While executing max number of active threads is 12. I`m using Jmeter 3.2 version, but also tried on 2.1.

Unfortunately I'm obtaining java.net.SocketException: Connection reset error for 20-30% requests. Full error at the end of the post.

I`ve already change properties mentioned in many similar topics here (for example : I m getting java.net.SocketException: Connection reset exception while running a load test using Jmeter).

I've added:

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

in user properties

http.socket.timeout$Integer=120000 (such big value is set just for test reasons ;) )
http.connection.stalecheck$Boolean=true in hc.parameters

httpclient.timeout=1200000 
httpclient4.idletimeout=1200000 (same as previous) in jmeter.properties

I've also changed HTTP Request Sampler default values in Advanced tab to: HTTPClient4 and both timeouts set to 120000.

Note: So big test timeouts are related to the time that some of request can take on service side (even 10 minutes).

Unfortunately after all those changes, I`m still getting this error and people responsible for the service, after analysis answered that it is nothing on their side.

Full error:

java.net.SocketException: Connection reset;
    at java.net.SocketInputStream.read(Unknown Source);
    at java.net.SocketInputStream.read(Unknown Source);
    at sun.security.ssl.InputRecord.readFully(Unknown Source);
    at sun.security.ssl.InputRecord.read(Unknown Source);
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source);
    at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source);
    at sun.security.ssl.AppInputStream.read(Unknown Source);
    at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:158);
    at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82;
    at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:271);
    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:281);
    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:654);
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:413);
    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:491);
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:425);
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254);
    at java.lang.Thread.run(Unknown Source);
1
with 10 threads no error occurs?user7294900
Didn`t test with 10 threads, but while was looking at execution live (partial reports on console (non-GUI mode) errors came up even when less than 10 threads were active)Daniel Stachura
Any feedback on answer ? If ok it should be accepted and upvoted so that it's helpful to others. thanksUBIK LOAD PACK
I can't tell. My last try was to add keep-alive header to request, unfortunately tests were canelled and we are not authorized now to get response from service. There is a chance that tests will start again, in that case i'll provide update if it helps or not.Daniel Stachura

1 Answers

0
votes

First use JMeter 3.2 version.

Then try first manually the website, does it work correctly ?

If yes, run JMeter with 1 thread and check, if Connection Reset occur, then you most probably are not reproducing identically what browser does. In this case, record and try again.

If this only happens with many users, then your server is rejecting connection either due to an issue or a misconfiguration.