For some requests getting java.net.ConnectException: handshake timed out

Hi,

Getting following exception for the last around 5 to 20 users,

java.net.ConnectException: handshake timed out
at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:168)
at org.asynchttpclient.netty.channel.NettyConnectListener$1.onFailure(NettyConnectListener.java:139)
at org.asynchttpclient.netty.SimpleFutureListener.operationComplete(SimpleFutureListener.java:26)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:500)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:479)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:420)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:122)
at io.netty.handler.ssl.SslHandler.notifyHandshakeFailure(SslHandler.java:1443)
at io.netty.handler.ssl.SslHandler.access$1100(SslHandler.java:161)
at io.netty.handler.ssl.SslHandler$5.run(SslHandler.java:1613)
at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:120)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:399)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:464)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLException: handshake timed out
at io.netty.handler.ssl.SslHandler.handshake(…)(Unknown Source)

Following is the scenario and settings,
For each user,
Request1: getting access token for authorization
Request2: login using credentials and accss token from Request1

I am using 6 users and credentials are being feeded using JSON file feeder with circular.
Logger level is “ERROR”.

Trying to test the limit number of users the application handles at the same time.

Using atOnceUsers(1) and following is the problem,

Getting above exception for the number of failed request,

atOnceUsers(30) → 27 Success 2 Failed
atOnceUsers(50) → 46 Success 4 Failed
atOnceUsers(100) → 94 Success 6 Failed
atOnceUsers(150) → 144 Success 10 Failed / sometimes 15 failed
atOnceUsers(200) → 186 Success 14 Failed / sometimes 18 failed
atOnceUsers(300) → 282 Success 18 Failed / sometimes 22 failed / sometimes 38 failed

What could be the cause? Thanks in advance.

This does not seem to be a Gatling issue, rather a application server issue which probably is not able to process all the requests and thus results in some timeouts.
Well, if you want to find the limit of the application, instead of just running all the 300 users at the same time and each executing the flow just once, better goal would be to find the limit of the application in terms of requests per second in a test which is run over a longer period of time.
And then check the error rate and response time behavior with increase in the traffic.

Ex. inject(rampUsersPerSec(1) to 300 during(30 minutes))