性能测试工具 jmeter 一个接口并发 1000,结果一小部分返回 Connection timed out: connect

chen · 2017年09月07日 · 最后由 burenxin 回复于 2020年05月27日 · 5860 次阅读

jmeter 一个接口并发 1000。一小部分返回
java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:121)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.jmeter.protocol.http.sampler.hc.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:318)
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.open(MeasuringConnectionManager.java:114)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:654)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:413)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:491)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:425)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254)
at java.lang.Thread.run(Unknown Source)
求解

共收到 5 条回复 时间 点赞

错误代表到服务器的网络连接超时, 如果比例很小也可能是正常情况.
需要你监控服务器的网络流量,看看有没有超过网络带宽.
另外如果其他响应时间普遍较长的话,说明服务端性能不够好.

解决了吗。我也遇到这个问题了。服务端没有报错,但是 jmeter 工具报 java.net.ConnectException: Connection timed out: connect

chen #3 · 2018年12月29日 Author
回复

Tomcat 线程池占满导致的

遇到类似问题,jmeter 线程数设置的很大,无法结束,需要强制退出。另外,TCP 请求好好的,突然就 Response code: 500,Response message: java.net.ConnectException: Connection timed out: connect 了,无法连接了,在线等,挺急的,哪位大神可以贡献下解决方案,跪谢。

我在内网开到 500 个线程时报连接超时,用外网时开到 900 个线程池时报错,感觉是自己网络的原因

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册