Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
810 views
in Technique[技术] by (71.8m points)

multithreading - JMeter - Connection reset and SSL errors when load test more than 120 threads in windows 7

I'm trying to load test website with latest JMeter 3.3 from windows 7/10

When threads are 120 or above I start getting SSL handshakes failures from F5.

When I add -Djavax.net.debug=all to execution I found many different socket exceptions as:

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.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)

Or

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)

Or

 java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at sun.security.ssl.OutputRecord.writeBuffer(Unknown Source)
at sun.security.ssl.OutputRecord.write(Unknown Source)

I follow answer, but it may be outdated:

Make sure that your HTTP Requests "Implementation" is HTTPClient4 Add the following lines to user.properties file (located in /bin folder of your JMeter home)

httpclient4.retrycount=1 hc.parameters.file=hc.parameters In the hc.parameters file (same location - JMeter's /bin folder) uncomment the next line:

http.connection.stalecheck$Boolean=true

How can prevent those errors? I tried adjusting ramp up period but it didn't helped. I also tried adding EnableConnectionRateLimiting registry suggested here and failed.

Did I reach the limit to JMeter on windows or can it be configured/increased?

EDIT

I tried setting HTTP with different retry count and with Java implementation but no change.

EDIT2

I found that using specific proper TLSv1.2 protocol for my HTTP Request fixed the issue, in jmeter.properties add the line:

https.socket.protocols=TLSv1.2

There was enhancement for make http parameters configurable.

This enable me to increase load up to ~220 threads without SSL handshake errors in the ramp up period.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You may need to adjust windows tcp settings to avoid reaching opened port limits.

See this:

You need to set:

  • HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParametersMaxUserPort http://technet.microsoft.com/en-us/library/aa995661.aspx
  • HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParametersTcpTimedWaitDelay http://technet.microsoft.com/en-us/library/bb397379.aspx Windows 2003 Reduce the TIME_WAIT by setting the TcpTimedWaitDelay TCP/IP parameter to 30 seconds on the windows registry key

  • HKLMSYSTEMCurrentControlSetServicesTcpipParameters, as a DWORD value. Increase the range of ephemeral ports by setting the MaxUserPort TCP/IP parameter to an higher value (like 32768), on the windows registry key HKLMSYSTEMCurrentControlSetServicesTcpipParameters, as a DWORD value. This will set the port range from 1024 to 32768.

  • Windows 2008 R2 Reduce the TIME_WAIT by setting the TcpTimedWaitDelay TCP/IP parameter to 30 seconds on the windows registry key HKLMSYSTEMCurrentControlSetServicesTcpipParameters, as a DWORD value. Increase the range of ephemeral ports by setting the dynamicportrange to an higher value through the command netsh int ipv4 set dynamicportrange tcp start=32767 num=65535, this will set the port range from 32768 to 65535.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...