Jmeter java.net.SocketException:连接重置(更改参数后)
Jmeter java.net.SocketException: Connection reset (after changing parameters)
最近我正在研究将测试第 3 方服务的性能脚本。
测试很简单,每个线程需要POST一个请求。
线程数 - 100,
加速 - 680 秒
执行时最大活动线程数为 12。
我正在使用 Jmeter 3.2 版本,但也在 2.1 上尝试过。
不幸的是,我正在获取 java.net.SocketException
:20-30% 请求的连接重置错误。 post.
末尾的完整错误
我已经更改了许多类似主题中提到的属性(例如:I m getting java.net.SocketException: Connection reset exception while running a load test using Jmeter)。
我添加了:
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
在用户属性中
http.socket.timeout$Integer=120000 (such big value is set just for test reasons ;) )
http.connection.stalecheck$Boolean=true in hc.parameters
httpclient.timeout=1200000
httpclient4.idletimeout=1200000 (same as previous) in jmeter.properties
我还将“高级”选项卡中的 HTTP 请求采样器默认值更改为:
HTTPClient4
并且两个超时都设置为 120000
。
注意:如此大的测试超时与某些请求在服务端可能花费的时间有关(甚至 10 分钟)。
不幸的是,在所有这些更改之后,我仍然收到此错误,负责服务的人员在分析后回答说这与他们无关。
完整错误:
java.net.SocketException: Connection reset;
at java.net.SocketInputStream.read(Unknown Source);
at java.net.SocketInputStream.read(Unknown Source);
at sun.security.ssl.InputRecord.readFully(Unknown Source);
at sun.security.ssl.InputRecord.read(Unknown Source);
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source);
at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source);
at sun.security.ssl.AppInputStream.read(Unknown Source);
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:158);
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82;
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:271);
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138);
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56);
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259);
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281);
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:257);
at org.apache.jmeter.protocol.http.sampler.hc.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:199);
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.receiveResponseHeader(MeasuringConnectionManager.java:212);
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273);
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125);
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:684);
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486);
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);
首先使用JMeter 3.2版本
那就先手动试一下网站,能正常运行吗?
如果是,运行 具有 1 个线程的 JMeter 并检查,如果发生连接重置,那么您很可能没有以与浏览器相同的方式重现。这种情况记录下重试
如果这种情况只发生在许多用户身上,那么您的服务器可能由于问题或配置错误而拒绝连接。
最近我正在研究将测试第 3 方服务的性能脚本。
测试很简单,每个线程需要POST一个请求。 线程数 - 100, 加速 - 680 秒
执行时最大活动线程数为 12。 我正在使用 Jmeter 3.2 版本,但也在 2.1 上尝试过。
不幸的是,我正在获取 java.net.SocketException
:20-30% 请求的连接重置错误。 post.
我已经更改了许多类似主题中提到的属性(例如:I m getting java.net.SocketException: Connection reset exception while running a load test using Jmeter)。
我添加了:
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
在用户属性中
http.socket.timeout$Integer=120000 (such big value is set just for test reasons ;) )
http.connection.stalecheck$Boolean=true in hc.parameters
httpclient.timeout=1200000
httpclient4.idletimeout=1200000 (same as previous) in jmeter.properties
我还将“高级”选项卡中的 HTTP 请求采样器默认值更改为:
HTTPClient4
并且两个超时都设置为 120000
。
注意:如此大的测试超时与某些请求在服务端可能花费的时间有关(甚至 10 分钟)。
不幸的是,在所有这些更改之后,我仍然收到此错误,负责服务的人员在分析后回答说这与他们无关。
完整错误:
java.net.SocketException: Connection reset;
at java.net.SocketInputStream.read(Unknown Source);
at java.net.SocketInputStream.read(Unknown Source);
at sun.security.ssl.InputRecord.readFully(Unknown Source);
at sun.security.ssl.InputRecord.read(Unknown Source);
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source);
at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source);
at sun.security.ssl.AppInputStream.read(Unknown Source);
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:158);
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82;
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:271);
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138);
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56);
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259);
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281);
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:257);
at org.apache.jmeter.protocol.http.sampler.hc.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:199);
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.receiveResponseHeader(MeasuringConnectionManager.java:212);
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273);
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125);
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:684);
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486);
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);
首先使用JMeter 3.2版本
那就先手动试一下网站,能正常运行吗?
如果是,运行 具有 1 个线程的 JMeter 并检查,如果发生连接重置,那么您很可能没有以与浏览器相同的方式重现。这种情况记录下重试
如果这种情况只发生在许多用户身上,那么您的服务器可能由于问题或配置错误而拒绝连接。