Thank you for your response.
I am using - Gatling 3.0.1, I had three questions here:
- Can you confirm if Gatling websocket stores some information (including the message payload) regarding messages received on the websocket?
- Is there a way to disable / reduce / clean up this information being stored for received messages?
- When gatling report shows that websockets crashed due to failure to allocate "direct memory" - which memory does this refer to and try to allocate?
Your response to these will be of great help, Thank you.
This is a simple example of what my script is doing:
- Gatling (client) sets up websockets and keeps them open for the entire simulation
- Gatling pushes messages into Kafka
- Server reads messages from Kafka and pushes each message on one of the websockets it is meant for
- We see that with Gatling 2.x this worked fine (constant memory usage on client), but with Gatling 3.x memory seems to be linearly rising based on the messages received on the websocket
- We see that the linear increase also depends on the size of the payload used (My payload is about 1.5 kB)
______________________________________________ [ Code Sample ] ______________________________________________
private val httpProtocol: HttpProtocolBuilder = http
.baseUrl(baseURL)
.acceptHeader("application/json;q=0.9,*/*;q=0.8")
.doNotTrackHeader("1")
.acceptLanguageHeader("en-US,en;q=0.5")
.acceptEncodingHeader("gzip, deflate")
.userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0")
private val kafkaMessageScn = scenario("publishKafkaMessage")
.exec(feed(kafkaFeeder))
.forever(
exec { session =>
val trackingId = Random.alphanumeric.take(32).mkString
info(s"setting trackingID $trackingId for user : ${session.userId} ")
session.set("trackingId", trackingId)
}.exec(publishNotification("kafka-publish-payload", payload))
)
private val registerWSScn = scenario("Notifications service load test")
.exec(feed(userDatafeeder))
.exec(registerClientWithOptionalHeaders)
.exitHereIfFailed
.pause(1)
.exec(openWebSocket)
.pause(loadTotalTime)
.exec(closeWebSocket)
setUp(
registerWSScn
.inject(rampUsers(totalUsers) during usersRampUpTime.seconds)
.protocols(httpProtocol),
kafkaMessageScn
.inject(nothingFor((usersRampUpTime + 60).seconds), rampUsers(kafkaUsers) during usersRampUpTime.seconds)
.throttle(ThrottleSteps: _*)
.protocols(kafkaProtocol)
)
_________________________________________________________________________________________________
Any help on this will be very appreciated.
Thank you.