Search code examples
scalaperformance-testingload-testinggatling

What is gatling's "inferHtmlResources" resource limits?


The Issue

Gatling script is currently stopping at 14 requests and doesn't continue iterating in the scenario. Can't understand why...

The Background // The Setup

I had a set of pages that was being tested successfully in Gatling until I had the need to move the static assets into a new subdomain.

On a first stage and to evaluate the capacity of the new servers, the first step on doing that move was done via redirects (301) to the new domain - let's call it assets.testdomain.com (and yes we're aware this isn't the ideal approach - this was done to allow for work to proceed without backend code changes).

After the above mentioned changes were applied, most of our pages stopped iterating on the load test and would stop at 14 requests (HTML request + 13 css, js and image assets).

We've noticed that Gatling is following the redirects as expected and that iff the page has a small amount of assets in it, no issues were observed (scenario runs as intended).

The Gatling Script

Here's the overall outline of my script:

  val httpProtocol = http
    .baseURL("https://www.testdomain.com")
    .inferHtmlResources(BlackList(), WhiteList("https://.*.testdomain.com.*."))
    .acceptHeader("image/webp,image/apng,image/*,*/*;q=0.8")
    .acceptEncodingHeader("gzip, deflate")
    .acceptLanguageHeader("en-US,en;q=0.9")
    .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36")

  val SamplePage_0 = Map(
    "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "Upgrade-Insecure-Requests" -> "1")

  val test_duration = 4 minute
  val pacing = 0 second
  val think_time = 10 second

  val SamplePage = scenario("SamplePage")

    .during(test_duration) {
      pause(pacing)
        .repeat(28) {
          pause(think_time)
            .exec(flushHttpCache)
            .group("SamplePage") {
              exec(http("request_0")
                .get("/samplepage")
                .headers(SamplePage_0))
            }
        }
    }

  setUp(
    SamplePage.inject(rampUsers(1) over (1 minute)),
  ).protocols(httpProtocol)

Solution

  • Known issue, fixed in Gatling 3: https://github.com/gatling/gatling/issues/3449