I am trying to measure the performance of a single REST endpoint (GET) with Gatling, with a very simple setup like this one:
val httpProtocol: HttpProtocolBuilder = http
.baseUrl("https://domain:8085")
.acceptHeader("*/*");
val scn =
scenario("MyScenario")
.exec(
http("MyRequest")
.get(myPath)
)
setUp(scn.inject(rampUsersPerSec(1) to (1) during (10 seconds))).protocols(httpProtocol)
Which means 1 request per second.
The problem is that the min response time is more than 500ms, average 600ms, but if I do the same test manually with Postman, same endpoint and parameters, the response time is between 150ms and 250ms.
Why could be this difference appear? How can I track the issue?
I verified that the execution time in the server side is the same for both.
Thank you!
Which means 1 request per second- no it doesn't, it means 1 thread executing requests for 10 seconds as fast as it can, given you state response time is around 500ms my expectation is that around 20 requests have been executed which gives approximately 2 requests per second. I don't think it is the real issue, but it's not the "same test"It's also not the "same test" when it comes to HTTP Headers, Postman sends few more by default like
Postman-Tokenand especially Accept-Encoding which is missing in your Gatling test and present by default in Postman requests and this guy can have quite big impactIn order to be absolutely to send the same request that Postman sends you can just record it using Gatling Recorder