Using Gatling for load testing hundreds permanent connections

573 views
Skip to first unread message

Jean-Marc van Leerdam

unread,
Mar 18, 2016, 9:24:14 AM3/18/16
to Gatling User Group
Hello group,

I am new to this group, and new to Gatling (using version 2.1.7 at the moment).

I want to use Gatling to perform a continuous load test on a Zookeeper cluster, simulating hundreds of connected clients that periodically execute requests (like querying the zookeeper content, adding/removing ephemeral nodes). 

At the moment I have a test scenario running, but it is creating a new connection for each request. And that is not simulating the actual production usage accurately.

What is the proper way to model the following behaviour in Gatling (if at all possible):
  • Initialize the Zookeeper cluster (pre-load it with data)
  • Spin up 200 client connections that remain active and are reused
  • For 6 hours have these 200 clients perform requests to Zookeeper every couple of minutes
    • Preferably I create several types of clients (i.e. one or two 'heavy hitters', a bunch of 'frequent users' and a large group that hardly does anything except keeping the connection active)
  • Stop/close the clients
  • Finish the testrun
Should I create a scenario per client, or per type of client? How would I translate the gatling load injection to client actions?

I have created a plugin setup similar to the gatling-kafka plugin available on Github, but struggle with the '1 request == 1 new connection' of that setup. The connection is made at execution time (in the executeOrFail implementation).

Apologies for the rather abstract question, any pointers to documentation that explains how this kind of simulation is possible is appreciated.

I appreciate that Gatling is primarily geared to HTTP load testing, which is a rather 'connection-less' protocol, so support for my requirements may not be easy.

Regards,

Jean-Marc.

arodr...@stratio.com

unread,
Oct 13, 2016, 9:27:40 AM10/13/16
to Gatling User Group
Hi Jean-Marc,

Have you gone any further with this approach? I'm facing a quite similar scenario and I'm very interesting.

Thank you in advance. Regards,

Alberto

Adrian Lewis

unread,
Oct 19, 2016, 11:17:58 AM10/19/16
to Gatling User Group
Use atOnceUsers(200), loop your request with a pause and set maxDuration to 6 hours. 

Sajjad Lateef

unread,
Oct 20, 2016, 11:43:45 AM10/20/16
to gatling
Jean-Marc,

I presume that the Zookeeper client is a TCP client that keeps a long-running connection and transfers data over it periodically. And, there is some sort of heartbeat to keep the connection up? 

For a custom TCP server we have, we had to develop a Java library which maintained a thread for each TCP connection and implemented the custom binary protocol. 
This library was integrated with Gatling's async "virtual users".

It took a single developer over three months to implement this customized gatling module and java library. 

Thanks
Sajjad


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Sajjad Lateef  sajjadlateef (a) acm.org
slateef.gc (a) gmail.com

Stéphane LANDELLE

unread,
Oct 20, 2016, 11:46:07 AM10/20/16
to gat...@googlegroups.com
It took a single developer over three months to implement this customized gatling module and java library. 

You'd should have contracted with us :) :) :)

Stéphane Landelle
GatlingCorp CEO

Jean-Marc van Leerdam

unread,
Oct 24, 2016, 2:15:07 AM10/24/16
to gat...@googlegroups.com
Hi Alberto,

(I was on holiday, so apologies for the late reply).

Yes, I have successfully created a Protocol + RequestActionBuilder + RequestBuilder to use a single zookeeper connection and have Gatling send multiple requests through it during simulations.
Unfortunately the code is currently closed under NDA as it belongs to my employer. I'll see if I can reproduce it in my spare time (it's not very complicated, and definitely did not take more than a couple of hours to write; nowhere near the three months Sajjad reported).

Please note that we used Gatling 2.1.7 at the time, to connect to Zookeeper 3.4.6.

I've since moved to other areas and am not actively using that code anymore, but I will try to find some time this week to put something on Github.

Regards,

Jean-Marc.


--
You received this message because you are subscribed to a topic in the Google Groups "Gatling User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gatling/pPV6Baku0aE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gatling+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Regards,

Jean-Marc

arodr...@stratio.com

unread,
Oct 24, 2016, 6:29:19 AM10/24/16
to Gatling User Group
Hi Jean-Marc,

thank you very much for replying. It would be awesome if you can share the code in github. Let me know if I can give you a hand!

Kind regards,

Alberto
To unsubscribe from this group and all its topics, send an email to gatling+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Regards,

Jean-Marc

Jean-Marc van Leerdam

unread,
Oct 27, 2016, 7:44:37 AM10/27/16
to Gatling User Group
Hi,


It shows the general approach, not the direct Zookeeper connection handling, as that is part of our internal client library (NDA :( ). But the approach should be clear enough to get you going and create a reusable zookeeper connection.

Regards,

Jean-Marc
Reply all
Reply to author
Forward
0 new messages