gpt4 book ai didi

jmeter - 我得到 java.net.SocketException : Connection reset exception while running a load test using Jmeter

转载 作者:行者123 更新时间:2023-12-04 03:26:53 25 4
gpt4 key购买 nike

我正在我的应用程序的登录页面上为 100 个用户运行负载测试 20 个用户正在通过其余 80 个用户我收到以下异常,请帮助我修复

java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:61)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:715)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:520)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:505)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:328)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1141)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1130)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:431)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:258)
at java.lang.Thread.run(Unknown Source)

最佳答案

我相信您正面临着 Connection Reset since JMeter 2.10 ? 中描述的问题。 JMeter 维基页面。如果您是 完全确定被测应用程序的行为是正确的,并且不需要在后端进行任何调整或调整,您可以配置 JMeter 以重试被拒绝的连接并检查过时的连接:

  • 将所有 HTTP 请求采样器的“实现”更改为 HttpClient4 .最简单的方法是使用 HTTP Request Defaults配置元素。
  • 在位于 JMeter 安装的/bin 文件夹下的 user.properties 文件中添加以下属性:
    httpclient4.retrycount=1
    hc.parameters.file=hc.parameters
  • 将下一行添加到 hc.parameters 文件(相同位置,JMeter 的/bin 文件夹)
    http.connection.stalecheck$Boolean=true
  • 重新启动 JMeter。

  • 您的“连接重置”问题应该会消失。

    关于jmeter - 我得到 java.net.SocketException : Connection reset exception while running a load test using Jmeter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29789800/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com