转自https://blog.csdn.net/miss_hua/article/details/50549606
使用jmeter做压测,当接口超时时,会导致接口报错,返回错误消息中提示socket关闭或network unreachable。需要更改jmeter.properties中的超时配置。
- Socket closed
-
Non HTTP response code: org.apache.http.NoHttpResponseException (the target server failed to respond)
资料查询:https://wiki.apache.org/jmeter/JMeterSocketClosed解决:修改httpclient4.idletimeout=<time in ms> 设置成自己觉得合理的时间,一般可设置成10-60s(表示连接空闲10s后才会断开),注意这边单位是ms。修改完成后再次压测,错误不再有了。