Srinivaso
Srinivaso

Reputation: 51

java.net.ConnectException message:Non HTTP response message: Connection refused in jmeter

I have a scenario to download zip file from a website. when trying to hit 100 users with jmeter getting success response for all 100 users,but when I try to do same for 150 users till 74 users got success response,means users downloading zip file without any error,but remaining users got below error as:: Getting sampler result: https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js code:Non HTTP response code: java.net.ConnectException message:Non HTTP response message: Connection refused

Request to provide solution for this

Upvotes: 3

Views: 1601

Answers (2)

Dmitri T
Dmitri T

Reputation: 168197

Never include external stuff (images, banners, videos, fonts, scripts, whatever) into your load test. My expectation is that you are being blacklisted by Google due to requesting this jquery.min.js with 150 concurrent users from a single IP address (which is not a real life use case)

The solution would be:

  1. Go to the HTTP Request Defaults configuration element
  2. Add the next line to "URLs must match" input:

    ^((?!google|facebook|pinterest|twimg|doubleclick).)*$
    

    This will filter out calls of "embedded" resources from the external servers like ajax.googleapis.com and few others (feel free to amend the above regular expression as needed)

    More information: Excluding Domains from the Load Test

It is also a good idea to add HTTP Cache Manager to the test plan as real browsers download scripts, styles, images, etc. but do it only once, on subsequent requests the aforementioned resources are being returned from the browser's cache. HTTP Cache Manager makes JMeter to behave like a real browser by simulating browser cache and respecting Cache-Control headers.

Upvotes: 0

UBIK LOAD PACK
UBIK LOAD PACK

Reputation: 34566

This may mean that your server is overloaded or misconfigured and does not allow additional request so rejects them.

Ensure before that you're not hitting a network contention.

Upvotes: 1

Related Questions