21

I have a prepared a jmx file using jmeter & ran that test case on blazemeter to test load on my server. After the test is done, I can see that one of my services are failing. Though not all the time, but some times. And in the error tab on blazemeter, i can see that is is giving

Non HTTP response message: The target server failed to respond

I am not sure, that is my server failing to handle the load, or is it something else. In My settings, thread is 50. Can any one please help me that, is this because of server is failing to handle to load. Thanks in advance.

Yeasin Hossain
  • 769
  • 2
  • 6
  • 23

5 Answers5

33

It looks like that you're facing the problem described in Connection Reset since JMeter 2.10 ? Wiki article.

If you upgraded recently to JMeter 2.10 or 2.11, you may have noticed increased errors of this type:

Socket closed

Non HTTP response code: org.apache.http.NoHttpResponseException (the target server failed to respond)

So

  1. Change "Implementation" of your HTTP Requests to HTTPClient4

  2. Add the next 2 lines to user.properties file (usually lives under /bin folder of your JMeter installation)

    httpclient4.retrycount=1
    hc.parameters.file=hc.parameters
    
  3. In hc.parameters file (also lives under JMeter's /bin folder) uncomment the following line:

    http.connection.stalecheck$Boolean=true
    

For more information on different JMeter properties and ways of setting and altering them refer to Apache JMeter Properties Customization Guide

Community
  • 1
  • 1
Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • I am going to run the jmx file on blazemeter. So i wont be able to change the user.properties & hc.parameters files. Will it be enough to just change the HTTPClient4. – Yeasin Hossain Jan 15 '15 at 07:18
  • 1
    I believe that if you upload your `user.properties` and `hc.properties ` files along with your test script they'll be picked up. As per Apache JMeter Properties Customization Guide - `For “user.properties” and “system.properties” files overrides – just drop them to the same place where .jmx and .jar files usually go.` – Dmitri T Jan 15 '15 at 08:11
  • I think you meant hc.parameters in your comment, Dmitri T? – theJerm May 11 '15 at 19:42
  • Good catch, indeed it should be `hc.parameters` or anything matching "hc.parameters.file" property value, thanks. – Dmitri T May 12 '15 at 07:56
  • @DmitriT, i am running into the same issue 'Non HTTP response code: org.apache.http.NoHttpResponseException (the target server failed to respond)' even after following your steps. I am seeing the issue with thread count of 50 and ramp-up times of 10 seconds or 60 seconds. But the issue does not exist if the ramp-up time is 120 seconds. I am using Jmeter 3.0, which is the latest version. Do you think it is my server that is not able to handle the load?. Please help! Thank you!. – sridhar249 Jul 14 '16 at 02:56
  • Most likely yes. You can use [PerfMon Metrics Collector](https://www.blazemeter.com/blog/how-monitor-your-server-health-performance-during-jmeter-load-test) listener to identify whether it is due to lack of resources on server side or the problem lives somewhere else, i.e. non-optimal web server and/or database configuration or performance bug in your application – Dmitri T Jul 14 '16 at 05:43
  • I have been stuck at a similar issue for almost a week now, and I just stumbled across this answer, and it's a lifesaver! thanks Dmitri! – Raaz Aug 24 '16 at 14:59
  • I am still facing the same issue even after doing this! @DmitriT ca you help – Vishal Puliani Oct 20 '16 at 10:29
  • @DmitriT i also get the same error but only when i run with 15000 con current users and if used 5000 users same run i dont get error. is this mean that my server is not able to hsndle ? or should i change from http request to httpClient4? – Ankita Oct 15 '18 at 05:23
  • I had the same issue in JMeter 5.2.1 and your answer fixed it. – Tom Regan Dec 20 '19 at 21:02
  • The above resolution didn't help us in our case. Posted the solution that worked for us in the answers section. – Jyotin Ranpura Dec 18 '20 at 11:02
  • I'm having the same issue in Jmeter 5.4.1 (latest) anyone else got this?? – Vajira Prabuddhaka Jul 07 '21 at 09:05
2

Encountered the same issue and fixed it by unchecking the "Use KeepAlive" option for HTTP requests. Please refer to the screenshot. I guess, the root cause was related to the connection being closed and the JMeter client trying to use the same connection.

Uncheck KeepAlive option

  • This is fixing the issue, but it seems throughput reduces with this approach.. any idea why?? – Vajira Prabuddhaka Jul 07 '21 at 09:04
  • 1
    @VajiraPrabuddhaka - Just guessing here: turning the KeepAlive option off will need to create a new TCP connection on each HTTP request which might be an overhead and reduce the throughput. You can read more here - https://www.imperva.com/learn/performance/http-keep-alive/ – Jyotin Ranpura Aug 17 '21 at 04:31
1

Had similar problem for jmeter 2.13 DmitriT solution got me pointed in right direction, but in my case the java or HttpClient3.1 worked, 4.0 did not.

Paul
  • 7,155
  • 8
  • 41
  • 40
1

I have done everything.

ange "Implementation" of your HTTP Requests to HTTPClient4 Add the next 2 lines to user.properties file (usually lives under /bin folder of your JMeter installation)

httpclient4.retrycount=1 hc.parameters.file=hc.parameters In hc.parameters file (also lives under JMeter's /bin folder) uncomment the following line:

http.connection.stalecheck$Boolean=true

BUT STILL FACING THIS ISSUE in apache jmeter 5.1

0

In my case it was the header for the call I was doing that was causing the issue. It was:

Content-Type:application/json;charset=UTF-8

Set it to:

Content-Type:application/json
Kotie Smit
  • 646
  • 1
  • 5
  • 18
  • @Dmitri I am facing same problem and tried above configuration but still issue persist. Is this issue from Apache end or server is not capable of handling such requests? – Anonymous Mar 18 '17 at 15:43