Why number of active users high when begin to run test?

my code:


class shop extends Simulation {

  val userCount = 50000
  val duringTime = 180
  val url = http.baseUrl("https://www.xyz.com")

  val headerInfo = Map(
    "Accept" -> "application/json",
    "Cookie" -> "token=${token}",
    "Content-Type" -> "application/json"
  )

  def getPurchaseLimitCountFromDetail = scenario("getPurchaseLimitCountFromDetail")
    .feed(user)
    .exec(
      http("getPurchaseLimitCountFromDetail")
        .get("/rest/app/detail?item=123")
        .headers(headerInfo)
        .check(status.is(200))
    )

  var setUpList = List[PopulationBuilder]()

  setUpList :::= List(getPurchaseLimitCountFromDetail.inject(constantUsersPerSec(userCount) during (duringTime)).protocols(url))

  setUp(setUpList)

}

Why number of active users high when begin to run test? thanks!

Most likely because the OS is having a hard time opening 50,000 connections per second so first users experience a lag and last for more than 1 second.

thanks! How should I avoid it?

在 2019年9月25日星期三 UTC+8下午7:31:31,Stéphane Landelle写道: