Web applications needs to be tested from a Windows Server 2012 R2 machine. Performance tests are executed with JMeter 5.3 on 300-400 threads. During test execution, following errors are coming in JMeter, 1-2 per seconds after 20 seconds of test run:

Response code:Non HTTP response code: java.net.SocketException Response message:Non HTTP response message: Connection reset

I searched about this error and found, that it is probably caused by the setting of maximum number of TCP connections, that can be opened simultaneously. Output of Get-Item 'HKLM:\System\CurrentControlSet\Services\Tcpip\Parameters' :

                           UseDomainNameDevolution      : 1
                           EnableICMPRedirect           : 1
                           DeadGWDetectDefault          : 1
                           DontAddDefaultGatewayDefault : 0
                           KeepAliveTime                : 900000
                           KeepAliveInterval            : 10000
                           NV Domain                    : m53.local
                           ShutDownTimeAtLastDomainJoin : {11, 189, 171, 150...}
                           (default)                    :
                           TcpTimedWaitDelay            : 60
                           MaxUserPort                  : 65534
                           TcpNumConnections            : 16777214
                           TcpMaxDataRetransmissions    : 10

It seems size of TCP pool is enough, system has 16 GB RAM memory. How could I optimize system for performance testing?

1 Answer 1

  1. This "Connection Reset" might be caused by the system under test so I would start from checking its logs.

  2. If you're absolutely sure that it's JMeter to blame you can consider following recommendations from JMeterSocketClosed wiki page

  3. You might want to reduce TcpTimedWaitDelay to 30 so ephemeral ports would recycle faster

  4. You might want to add javax.net.debug=all line to system.properties file to see what's going on under the hood

  5. You might want to increase JMeter logging verbosity for HTTP protocol by adding the next lines to log4j2.xml file:

    <Logger name="org.apache.http" level="debug" />
    <Logger name="org.apache.http.wire" level="debug" />
  6. And finally some people state that changing HTTP Request implementation to Java helped, as the last resort you can switch it using HTTP Request Defaults:

    enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .