# Response time inconsistency

**URL:** <https://community.gatling.io/t/response-time-inconsistency/8289>\
**Category:** Gatling (Open-Source)\
**Created:** [September 8, 2023, 1:54pm UTC](https://community.gatling.io/t/response-time-inconsistency/8289 "2023-09-08T13:54:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zuhair](https://avatars.discourse-cdn.com/v4/letter/z/f475e1/32.png) [@Zuhair](https://community.gatling.io/u/Zuhair)\
**Post date:** [September 8, 2023, 1:54pm UTC](https://community.gatling.io/t/response-time-inconsistency/8289/1 "2023-09-08T13:54:43Z")

</div>

Hi team,

Currently, we are trying to load test our API’s against 4000 TPS. In the httpRequestBuilder, I have added check for response time to be less than 3000ms. We also record integration and response latency of the request in our API gateway logs. So, when we execute the test, we have some requests taking greater than 3000ms, but in our API gateway logs it takes less time.

So, what may be the reason for this irregular response time in gatling?

Below attached the httpRequestBuilder:

 ![Gatling_req](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/6/678c7eef73e5ae225d09cd9f1ad612bb8636243b.png)

 ![API_gateway_req](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/e/eacd7cc5e2a8ebd64026da6b8b7d897a6fc4b101.png)

```auto

  def licenseByTID(name: String, subEndpoint: String): HttpRequestBuilder = {
    http(name)
      .get(PerfConfig.emsBaseUrl + subEndpoint)
      .header("Authorization", "Bearer ${accessToken}")
      .check(status is 200)
      .check(jsonPath("$.items[*]").count.gt(0))
      .check(responseTimeInMillis.lte(3000))
  }

  /*------get all licenses by tid and feature prefix------*/
  val getAllLicensesTidAndFeaPre: HttpRequestBuilder = licenseByTID("license_GetAllLicensesTidAndFeaPre", "/licenses?tid=${holder_id}&featurePrefix=${featurePrefixes}")
    .check(jsonPath("$.nextPage").saveAs("tidFeaPreNextPage"))

```

---

<div class="post-metadata">

**Author:** ![GatlingPete](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/gatlingpete/32/1167_2.png) [@GatlingPete](https://community.gatling.io/u/GatlingPete)\
**Post date:** [September 8, 2023, 2:55pm UTC](https://community.gatling.io/t/response-time-inconsistency/8289/2 "2023-09-08T14:55:44Z")

</div>

Hello there,

It’s not really for us to say 🙂 Gatling is just the messenger here, it shows the response time it receives. It could be any of the below or other issues:

Networking  
Proxy  
DNS  
TLS  
etc.

With Gatling Enterprise you can get additional metrics that can help you narrow down the cause (TLS duration, DNS resolution, etc.) but with the information here we can’t be too sure as we don’t know anything about the application/environment.

All the best,  
Pete

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [September 8, 2023, 4:31pm UTC](https://community.gatling.io/t/response-time-inconsistency/8289/3 "2023-09-08T16:31:10Z")

</div>

Also, typical reasons for unstable response times load testing:

- from a laptop, with other processes competing for resources (CPU, memory, network)
- from a Windows machine with antivirus one =\> go with a linux server instead
- over wifi

---

<div class="post-metadata">

**Author:** ![Zuhair](https://avatars.discourse-cdn.com/v4/letter/z/f475e1/32.png) [@Zuhair](https://community.gatling.io/u/Zuhair)\
**Post date:** [September 8, 2023, 4:44pm UTC](https://community.gatling.io/t/response-time-inconsistency/8289/4 "2023-09-08T16:44:33Z")

</div>

Hi @slandelle , we are running on an AWS EC2 instance and also in the same region where our services are running. So that, it is strange for us to get some inconsistent response time in gatling because there should not be any network latency also.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [September 8, 2023, 4:57pm UTC](https://community.gatling.io/t/response-time-inconsistency/8289/5 "2023-09-08T16:57:12Z")

</div>

Then either you’re saturating your load generator, or your application is indeed unstable.

Note: Gatling Enterprise would help you troubleshoot your DNS, TCP, TLS and load generator issues.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [October 8, 2023, 4:57pm UTC](https://community.gatling.io/t/response-time-inconsistency/8289/6 "2023-10-08T16:57:53Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
