给出NoHttpResponseException的Jmeter:目标服务器无法响应错误

时间:2015-02-05 19:03:52

标签: apache jmeter

我正在对域进行性能测试。 我得到了Non HTTP response message: The target server failed to respond response message.

以下是日志的快照。

<requestHeader class="java.lang.String">Connection: keep-alive
Accept-Language: de
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0
Accept-Encoding: gzip, deflate
Pragma: no-cache
Authorization: Basic Y2FzZXdvcmtlcjAxOjFxYXkiV1NY
Content-Type: application/x-www-form-urlencoded
Content-Length: 218
Host: mydomain.test.com
</requestHeader>
  <responseData class="java.lang.String">org.apache.http.NoHttpResponseException: The target server failed to respond&#xd;
                at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:95)&#xd;
                at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:61)&#xd;
                at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)&#xd;
                at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)&#xd;
                at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)&#xd;
                at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)&#xd;
                at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)&#xd;
                at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)&#xd;
                at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:715)&#xd;
                at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:520)&#xd;
                at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)&#xd;
                at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)&#xd;
                at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:481)&#xd;
                at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:298)&#xd;
                at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)&#xd;
                at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1105)&#xd;
                at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1094)&#xd;
                at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)&#xd;
                at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)&#xd;
                at java.lang.Thread.run(Unknown Source)&#xd;
</responseData>

我曾多次尝试过。甚至尝试减少线程数并以非常低的负载运行。

但每次,我都会在相同的测试用例(高负载和低负载)下获得40%的错误率。

Apache日志很干净。日志中没有错误。

请建议我还能检查什么。

1 个答案:

答案 0 :(得分:0)

我建议你增加超时或设置请求之间的暂停,可能是你的服务器无法快速响应。