jmeter测接口的错误率高的原因

Blade 未结 1 858
3092844924
3092844924 2021-06-22 23:10

一、该问题的重现步骤是什么?

1. 捕获.PNG

2. 捕获.PNG

3.有什么办法可以降低错误率?特别是测试时间有时有2个小时的,有的36分钟就开始出现大量错误请求,是时间过期了token认证吗,怎么解决时间长,错误率增大的问题?


因为时间长了之后,在网页访问上还是可以继续访问的,所以  问题是哪里?


二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?


四、请提供详细的错误堆栈信息,这很重要。

org.apache.http.conn.HttpHostConnectException: Connect to 122.9.34.174:80 [/122.9.34.174] failed: Connection timed out: connect

at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)

at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$JMeterDefaultHttpClientConnectionOperator.connect(HTTPHC4Impl.java:404)

at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)

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:935)

at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:646)

at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)

at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1296)

at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285)

at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638)

at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)

at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)

at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)

at java.lang.Thread.run(Unknown Source)

Caused by: 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.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)

at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)

... 19 more

五、若有更多详细信息,请在下面提供。

1条回答
  •  admin
    admin (楼主)
    2021-06-23 00:46

    主要得看你设置的线程数和每秒启动的线程来看,不同的配置有不同的结果。

    每个服务都是有一个极限的,你超过之后性能自然就差了. 另外如果是token接口,因为涉及到多层feign调用,性能会稍差一些,你需要多启动几个服务保证性能。

    你可以看下我本地用单服务测试的接口的报告

    image.png

    image.pngimage.png

    0 讨论(0)
提交回复