Exactly I could able to provide you the complete script as the resource is not public but the below script can give you the idea of what I am trying to say.
Using the below script I am trying to achieve 300 RPS but the max I could able to achieve is 240 RPS and looking the way to improve the RPS.
I am just trying to understand what could be the possibility to increase the RPS, either the system configuration is not enough that I am using to run the load test or do I need to change something from the gatling side like gatling configuration to increase the RPS.
val HTTP_PROTOCOL = http
.inferHtmlResources(BlackList(), WhiteList())
.baseUrl(“https://100.92.121.196”)
.userAgentHeader(“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36”)
.disableWarmUp
.disableFollowRedirect
.shareConnections
.disableCaching
val constantUsersPerSceScenario =
scenario(“load test scenario”).repeat(1) {
exec(http(“Load Test scenario”)
.post("/trace")
// .header(“Authorization”, s"Bearer ${tokenId}")
.body(StringBody(s"""{
“spans”: [
{
“msg”: “Root span started”,
“sentiment”: “like”,
“trace_id”: “50e44c6c59c948bbb7b13199827ac7ea”,
“component”: “abc”,
“level”: “trace”,
“span_id”: “0000017297b85dfc”,
“session_id”: “0000017297b85dfa”,
“message_type”: “span/start/root/browser”,
“message_id”: “loadtestmsg123”,
“error”: “false”,
“ts”: “1591683341819”
},
{
“msg”: “Root span finished”,
“sentiment”: “like”,
“trace_id”: “b247021853e948ebbe2fd0c45bda714c”,
“level”: “trace”,
“span_id”: “1234”,
“end_time”: “1591683343351”,
“session_id”: “6789”,
“message_type”: “span/end/root/browser”,
“message_id”: “loadtestmsg123”,
“error”: “false”,
“duration”: 2,
“screen.height”: 914,
“component”: “abc”,
“screen.width”: 1920,
“screen.orientationType”: “landscape-primary”,
“ts”: “1591683342351”
}
]
}""".stripMargin)).asJson
.processRequestBody(gzipBody)
.header(HttpHeaderNames.ContentEncoding, “gzip”)
.check(status.in(200)))
}
setUp(
constantUsersPerSceScenario.inject(
nothingFor(5 seconds),
constantUsersPerSec(300) during (300 seconds)))
.assertions(global.successfulRequests.percent.gt(0))
.protocols(HTTP_PROTOCOL)
Thanks,
Ratnesh.