Christian Kreutzfeldt Christian Kreutzfeldt - 3 months ago 44x
Java Question

JMeter test on Netty-based impl produces error for every second request

I've implemented an HTTP service based on the HTTP server example as provided by the project.

When I execute a GET request to the service URL from command-line (wget) or from a browser, I receive a result as expected.

When I perform a load test using ApacheBench

ab -n 100000 -c 8 http://localhost:9000/path/to/service
, experience no errors (neither on service nor on ab side) and see fair numbers for request processing duration.

Afterwards, I set up a test plan in JMeter having a thread group with 1 thread and a loop count of 2. I inserted an HTTP request sampler where I simply added the server name
, the port number
and the path
. Then I also added a
View Results Tree
and a
Summary Report

Finally, I executed the test plan and received one valid response and one error showing the following content:

Thread Name: Thread Group 1-1
Sample Start: 2015-06-04 09:23:12 CEST
Load time: 0
Connect Time: 0
Latency: 0
Size in bytes: 2068
Headers size in bytes: 0
Body size in bytes: 2068
Sample Count: 1
Error Count: 1
Response code: Non HTTP response code: org.apache.http.NoHttpResponseException
Response message: Non HTTP response message: The target server failed to respond

Response headers:

HTTPSampleResult fields:
DataEncoding: null

The associated exception found in response data tab showed the following content

org.apache.http.NoHttpResponseException: The target server failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(
at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.receiveResponseHeader(
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(
at org.apache.http.protocol.HttpRequestExecutor.execute(
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(
at org.apache.http.impl.client.DefaultRequestDirector.execute(
at org.apache.http.impl.client.AbstractHttpClient.execute(
at org.apache.http.impl.client.AbstractHttpClient.execute(
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(
at org.apache.jmeter.threads.JMeterThread.process_sampler(

As I have a similar service already running which receives and processes web tracking data which shows no errors, it might be a problem within my test plan or JMeter .. but I am not sure :-(

Did anyone experience similar behavior? Thanks in advance ;-)


Issue can be related to Keep-Alive management.

Read those:

So your solution is one of those:

If you're sure it's a keep alive issue:

  • Try jmeter nightly build

    Download the _bin and _lib files
    Unpack the archives into the same directory structure
    The other archives are not needed to run JMeter. 
  • And adapt the value of httpclient4.idletimeout

A workaround is to increase retry or add connection stale check as per :