Harry
Harry

Reputation: 4773

Socket closed error while performing load testing on jmeter

I am trying to run my load test on jmeter for REST api which is returning JSON.

I am passing the following header information in Header manager

 Authorization: Bearer VHFAJ0dxNQfJlzPmr7miaH4QOFeNVmez6RXVHX59uovrFAL6z5zMv9krpBAvOcNTwqHRFa8REaidlpuJSUMF8Ol38t7n-sHP2WQn0KmrEnFrtdo6XDRdhspVP1D72oIlu9sP_-rdv1MdsnakVewqrzZ9PeDiWhVKqRBTjWVlnZFpLS-CZ86DFanQ9cw7VZ67a1yOWC7_os7vZYeIhaQ8dM_8n_ocYzFDcCHELSGqnz3NHc9DRrQQfjM6xB17aRjUKQ4ZNV52Ss_1BKG8-5H7bMpi1QiAdDS17K55WrNAZMzgHeaP6UwtQwJyo_gxiaW5PlNJZNQQn4rZvNkIRd_V9Q
Content-Type: application/x-www-form-urlencoded 
Accept: application/json

Few days ego I tried the same test on local internal server and it was working fine. Now I am running this on UAT env which is setup on AWS.

This is working fine with chrome Postman extension.

Also I have followed the below link but no success and getting the socket closed exception

Non HTTP response message: The target server failed to respond: Is my server failing to handle load

java.net.SocketException: Socket closed at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180) at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294) at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.open(MeasuringConnectionManager.java:107) at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:517) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:331) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135) at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261) at java.lang.Thread.run(Thread.java:745)

Please let me know if more information is required

Upvotes: 0

Views: 19985

Answers (2)

Dmitri T
Dmitri T

Reputation: 168022

If your UAT deployment is behind Elastic Load Balancer or Elastic IP it may be the situation when JMeter resolves IP address of only one server and it becomes overloaded while others are idle.

Try adding DNS Cache Manager to your Test Plan to see if it helps. Check out The DNS Cache Manager: The Right Way To Test Load Balanced Apps guide for more information on the domain.

Upvotes: 2

UBIK LOAD PACK
UBIK LOAD PACK

Reputation: 34526

You should read this:

Note Socket closed can be an issue with your server.

Upvotes: 1

Related Questions