0

Iam trying to do a performance test against my application via JMeter. When i increase the number of threads(users) more than 100 i'm getting these errors. Please help me to fix this.

NB: This was working fine until i increased the no: of threads to 25000.
    Docker container is up and accepting connections(working fine with Postman)
[enter image description here][1]
[enter image description here][2]
[enter image description here][3]

org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:8080 [/127.0.0.1] failed: Connection refused (Connection refused)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$JMeterDefaultHttpClientConnectionOperator.connect(HTTPHC4Impl.java:404)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:935)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:646)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1296)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285)
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638)
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
    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:607)
    at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
    ... 19 more


  [1]: https://i.stack.imgur.com/Z6b1h.png
  [2]: https://i.stack.imgur.com/JDWYa.png
  [3]: https://i.stack.imgur.com/4Qtrx.png
Prabitha
  • 13
  • 4

2 Answers2

1

I don't think your "performance test" makes a lot of sense because:

  1. You're running JMeter and the system under test on the same machine, both can be very resource intensive and results won't be reliable due to race conditions
  2. You're running your test in GUI mode, it's for tests development and debugging, when it comes to tests execution you should be running your JMeter tests in command-line non-GUI mode
  3. You're running your tests on a laptop which is not connected to power supply so the power saving mode most likely will cause CPU to throttle
  4. You have a lot of Listeners enabled which don't add any value and just consume resources

Coming back to your question I can think of 2 possible reasons:

  1. You've exceeded the maximum number of open connections on the target webserver, check your backend HTTP server documentation to determine how to increase the number of open connections
  2. You've exceeded the maximum number of open connections on your operating system level, check the current limits and amend according to your test scenario.
Dmitri T
  • 159,985
  • 5
  • 83
  • 133
0

It seems like you're basically running a DoS attack against your own server.

  1. Check your server configuration for concurrency (e.g. Tomcat has a 'maxThreads'. Apache might have MPM enabled)
  2. Check if your JMeter test produces reasonable load. Does 1 thread represent 1 user? If so, do those users pause between requests? (Use a random wait in JMeter)
Simon
  • 2,994
  • 3
  • 28
  • 37
  • Hi Simon, Yes 1 thread means 1 user. Basically i want to know the average response time taken for 20k users to signup. So if i put wait then it will effect the speed right? – Prabitha Jun 20 '22 at 05:53
  • @Prabitha, yes, by adding waits between requests the server load is reduced. This might seem like cheating, but users take time reading your web content, entering form data etc., so adding waits creates a more realistic load pattern. There are plenty resources online how to do it, see e.g. https://www.baeldung.com/jmeter-delays-between-requests. Think about how long you take between loading a page and the next request. It's often a few seconds. – Simon Jun 20 '22 at 15:36