最近我正在測試第三方服務的性能腳本。Jmeter java.net.SocketException:連接重置(更改參數後)
測試很簡單,每個線程都需要POST一個請求。 線程數 - 100, 加速 - 680小號
在執行活動線程的最大數量是12。 我真的利用JMeter 3.2版本,但是還試圖上2.1。
不幸的是我獲得java.net.SocketException
:20-30%請求的連接重置錯誤。帖子結尾處的完整錯誤。
我已經更改了許多類似主題中提到的屬性(例如: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);
10線程沒有錯誤發生? – user7294900
雖然沒有測試10個線程,但是正在查看執行活動(即使少於10個線程活動時也出現了控制檯(非GUI模式)部分報告錯誤) –
任何有關答案的反饋意見?如果可以的話,應該被接受並向上提供,這樣對別人有幫助。謝謝 –