gpt4 book ai didi

multithreading - JMeter - 在 Windows 7 中负载测试超过 120 个线程时连接重置和 SSL 错误

转载 作者:太空宇宙 更新时间:2023-11-03 14:35:56 27 4
gpt4 key购买 nike

我正在尝试从 Windows 7/10 加载带有最新 JMeter 3.3 的测试网站

当线程数为 120 或以上时,我开始收到 F5 的 SSL 握手失败。

当我将 -Djavax.net.debug=all 添加到执行中时,我发现了许多不同的套接字异常:

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)

或者

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)

或者

 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)

我关注 answer ,但它可能已经过时了:

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

如何防止这些错误?我尝试调整加速期,但没有帮助。我还尝试添加 EnableConnectionRateLimiting 注册表建议 here 但失败了。

我是否达到了 Windows 上 JMeter 的限制,或者可以配置/增加它?

编辑

我尝试使用不同的重试次数和 Java 实现来设置 HTTP,但没有任何改变。

EDIT2

我发现为我的 HTTP 请求使用特定的正确 TLSv1.2 协议(protocol)解决了这个问题,在 jmeter.properties 添加行:

https.socket.protocols=TLSv1.2

enhancement 使 http 参数可配置。

这使我能够将负载增加到大约 220 个线程,而不会在启动期间出现 SSL 握手错误。

最佳答案

您可能需要调整 windows tcp 设置以避免达到打开的端口限制。

看这个:

你需要设置:

  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\MaxUserPort http://technet.microsoft.com/en-us/library/aa995661.aspx
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\TcpTimedWaitDelay http://technet.microsoft.com/en-us/library/bb397379.aspx window 2003通过将 Windows 注册表项上的 TcpTimedWaitDelay TCP/IP 参数设置为 30 秒来减少 TIME_WAIT

  • HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters,作为 DWORD 值。通过将 Windows 注册表项 HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters 上的 MaxUserPort TCP/IP 参数设置为更高的值(如 32768)作为 DWORD 值来增加临时端口的范围。这会将端口范围设置为 1024 到 32768。

  • Windows 2008 R2通过将 Windows 注册表项 HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters 上的 TcpTimedWaitDelay TCP/IP 参数设置为 30 秒来减少 TIME_WAIT,作为 DWORD 值。通过命令 netsh int ipv4 set dynamicportrange tcp start=32767 num=65535 将 dynamicportrange 设置为更高的值来增加临时端口的范围,这会将端口范围设置为 32768 到 65535。

关于multithreading - JMeter - 在 Windows 7 中负载测试超过 120 个线程时连接重置和 SSL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47902427/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com