JMeter javax.net.ssl.SSLHandshakeException:握手负载测试期间远程主机关闭连接

JMeter javax.net.ssl.SSLHandshakeException:握手负载测试期间远程主机关闭连接,jmeter,Jmeter,我试图使用Jmeter负载测试测试我的API,每当我试图在20秒或更长时间内测试10个或更多并发请求时,我都会遇到此错误: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source) at sun.security.ssl.SSLSocketImpl.p

我试图使用Jmeter负载测试测试我的API,每当我试图在20秒或更长时间内测试10个或更多并发请求时,我都会遇到此错误:

javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384)
    at org.apache.jmeter.protocol.http.sampler.hc.LazyLayeredConnectionSocketFactory.connectSocket(LazyLayeredConnectionSocketFactory.java:92)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$JMeterDefaultHttpClientConnectionOperator.connect(HTTPHC4Impl.java:326)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:850)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:561)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:67)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1282)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1271)
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:627)
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:551)
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:490)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at sun.security.ssl.InputRecord.read(Unknown Source)
    ... 27 more


10个并发用户持续10秒是成功的,但当我开始测试时,一些请求回答了上述错误,一些请求在测试期间成功。我认为这不再是一个代码问题。在这方面,我可以知道这方面有什么问题吗?我正在尝试从我的工作站(Windows)测试我的API对于API所在的Linux Dev服务器,我很好奇,为什么只有一些请求回复了此错误,而有些请求成功,因为我的API URL使用HTTPS。

如果您得到此
SSL对等点错误关闭
错误,则仅在负载下最有可能意味着您的测试系统过载,无法正常运行正确响应/优雅地结束连接

  • 在测试日志中检查您的系统是否存在任何可疑条目
  • 确保被测系统在CPU、RAM、网络等方面有足够的空间运行,可以使用
从JMeter方面来看,您可以:

  • 一定要跟上

  • >P>与被测试系统一样,确保JMIT不缺少底层操作系统资源,如果它确实考虑到

  • 您还可以将行添加到system.properties文件中,这样您将获得更多关于stdout中底层连接问题的信息

  • 此外,您还可以将下一行添加到log4j2.xml文件中,这样您将在中看到有关网络连接级别的更多详细信息

    
    

Hi Sir,在检查服务器时,测试期间的cpu使用率最高仅为32%,ram使用率在200-300mb之间,限制为8gb。我可以知道如果使用率低,这是否仍然是服务器问题吗?只是为了更新,我在密钥库中加载了我的ssl证书(.pfx),JMeter仍然响应错误
<Logger name="org.apache.http" level="debug" />
<Logger name="org.apache.http.wire" level="debug"/>