Nginx status code 499

I have a suite of Gatling tests (inherited for a legacy app), and we were happily running the tests with good results and no errors, however…
Our infrastructure is in AWS using EKS nodes, we have a series of Nginx gateways sitting in front of our apps, both the gateways and apps run in Kubernetes pods. So these tests try to prove that the number of Nginx and app instances are enough for the levels of traffic that we want.
After running the tests (again, no errors in the reports), we noticed something strange in the logs: there were many more requests to the Nginx pods than to the apps pods. And many Nginx requests were returning 499 http status code, but these errors were not being reported by Gatling, so we were thinking that the test results were successful, when in reality were pretty poor.
Is it possible that Gatling ignores status 499, since it’s not a standard HTTP status code?
In that case should it be as simple as to add a check in the HTTP definition of the test?

Is it possible that Gatling ignores status 499, since it’s not a standard HTTP status code?

No

but these errors were not being reported by Gatling,

I’m pretty sure your test overrides the default status check and makes this 499 status code considered OK, see Gatling - HTTP Checks and Gatling - HTTP Protocol

Thanks for answering.

This is the code, there are no checks:

  val HttpProtocol: HttpProtocol = http.baseUrl(s"https://$DgeApiRootUrl")
  setUp(
    GetPlaybackUrlScenario
      .GetPlaybackUrlScenario
      .inject(atOnceUsers(usersAtOnce)).throttle(
    reachRps(rpsPeak) in (rpsPeakTime minutes),
    holdFor(hold minutes)
  ))
    .protocols(Config.HttpProtocol)
    .assertions(global.successfulRequests.percent.gt(90))
    .assertions(global.responseTime.mean.lt(1000))
    .assertions(global.responseTime.percentile1.lt(1000)) // 50th percentile

Is Config.HttpProtocol what you have in your first line?

 val HttpProtocol: HttpProtocol = http.baseUrl(s"https://$DgeApiRootUrl")

Have you checked that this status check is not defined on individual requests either?

So I found this piece of code which seems to be the actual http request (sorry, as I said this is inherited code and I’m not very familiar with it):

  val GetPlaybackUrlRequest: HttpRequestBuilder =
    http(s"Get playback url")
      .get("/api/v3/streaming/events/${eventId}/stream?operatorId=${operatorId}&timestamp=${timestamp}&auth=${auth}&format=json&dvr=true&thumbnail=true")
      .check(status is 200)

So this only checks if the http status is 200, but what will happen if it’s not? The report shows some other errors like 502 or 401 if they happen, but not 499.

Proof that Gatling doesn’t swallow responses with status code 499 and fails the request as expected:

class Test499Simulation extends Simulation {

  val httpProtocol =
    http.baseUrl("https://test499.free.beeceptor.com/")

  val scn = scenario("Scenario")
  .exec(http("Root").get("/"))

  setUp(
    scn.inject(atOnceUsers(1))
  ).protocols(httpProtocol)
}

Unless you provide a minimal reproducer that exhibits an issue, we won’t be able to help here, only with consulting.

Thank you for your help.
I still have no idea why I’m not getting errors from Nginx 499. I’ll keep investigating.

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