【问题标题】:JMeter 5.4.1: java.net.SocketException: Socket Closed at the end of testJMeter 5.4.1:java.net.SocketException:测试结束时套接字关闭
【发布时间】:2021-06-24 15:34:09
【问题描述】:

无论我使用多少线程,Jmeter 在测试结束时都会显示错误。就在最后 - 直到那一刻没有错误。关闭线程时,最后几个线程失败,原因是:

Non HTTP response code: javax.net.ssl.SSLException message:Non HTTP response message: java.net.SocketException: Socket Closed

Non HTTP response code: javax.net.ssl.SSLException message:Non HTTP response message: java.net.SocketException: Socket Closed

Non HTTP response code: java.lang.IllegalStateException message:Non HTTP response message: Connection pool shut down

其中三个大部分时间都可以在一些失败的线程中找到。 我已经尝试了几乎所有在网上找到的解决方案(包括那些在 * 上的解决方案),但没有一个能解决问题。以下是我尝试过的示例的链接:

https://cwiki.apache.org/confluence/display/jmeter/JMeterSocketClosed
https://www.xtivia.com/blog/fixing-jmeter-socket-errors

脚本的设置:

  1. bzm - Concurrency Thread Group
  2. 用户定义的变量
  3. CSV Data Set Config
  4. HTTP Cache Manager
  5. HTTP Cookie Manager
  6. HTTP Request Defaults
  7. One of HTTP Requests

谁能帮帮我?

【问题讨论】:

    标签: java jmeter performance-testing


    【解决方案1】:

    当您的“保持目标速率时间”结束时,该问题似乎与异常线程终止有关。

    您确定您正在non-GUI mode 中运行测试并关注其他JMeter Best Practices

    选项在:

    1. 忽略错误,因为它们是客户端错误
    2. 引入ramp-down,这样线程将逐渐终止,可以使用Throughput Shaping Timer来完成
    3. 使用Filter Results Tool从 .jtl 结果文件中删除最后失败的请求
    4. 联系plugin developers and/or maintainers 并在那里报告问题

    【讨论】: