Active users grow with my custom protocol implementation and constantUsersPerSec

136 views
Skip to first unread message

Muneyuki Noguchi

unread,
Jan 28, 2015, 4:37:40 PM1/28/15
to gat...@googlegroups.com
Hello,

I implemented an Apache Kafka 0.8 protocol support using Gatling 2.1.3:
https://github.com/mnogu/gatling-kafka

However, the graph in an HTML report shows that active users grow even when I use constantUsersPerSec as the attached image file
though the number of threads in a java process doesn't grow so much during a stress test.

The simulation file I used is as follows:
https://github.com/mnogu/gatling-kafka/blob/0.0.2/src/test/scala/com/github/mnogu/gatling/kafka/test/BasicSimulation.scala

And the code to send requests to Apache Kafka 0.8 is as follows:
https://github.com/mnogu/gatling-kafka/blob/0.0.2/src/main/scala/com/github/mnogu/gatling/kafka/action/KafkaRequestAction.scala

Am I doing something wrong? If so, how to fix bugs in my code?

Thanks in advance.

active-users-growing.png

Stéphane LANDELLE

unread,
Jan 28, 2015, 7:24:13 PM1/28/15
to gat...@googlegroups.com
Hi,


As a results, you have a thread starvation, and users pile up in the starting queue without getting a chance to run.

As KafkaProducer.send returns regular Futures and not CompletableFutures so you can react on completion instead of blocking, you should use instead the version that takes Callback:

Get it?

Cheers,

Stéphane Landelle
Lead developer


--
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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Muneyuki Noguchi

unread,
Jan 29, 2015, 5:42:36 PM1/29/15
to gat...@googlegroups.com
The number of active users still grows with a callback, but the growth rate becomes smaller:
https://github.com/mnogu/gatling-kafka/blob/0.0.3/src/main/scala/com/github/mnogu/gatling/kafka/action/KafkaRequestAction.scala#L58


2015年1月29日木曜日 9時24分13秒 UTC+9 Stéphane Landelle:
callback.png

slan...@gatling.io

unread,
Jan 30, 2015, 1:39:35 AM1/30/15
to gat...@googlegroups.com
Are you sure creating and closing a producer on each event is the proper pattern? Is this how Kafka is supposed to be used? Shouldn't such component be reused and shared?


<callback.png>

Muneyuki Noguchi

unread,
Jan 30, 2015, 9:07:21 PM1/30/15
to gat...@googlegroups.com

Stéphane LANDELLE

unread,
Jan 31, 2015, 2:51:28 AM1/31/15
to gat...@googlegroups.com
Great!

Stéphane Landelle
Lead developer


Reply all
Reply to author
Forward
0 new messages