Arrival Phases

Learn how to specify the number of clients StormForge Performance Testing should launch

StormForge Performance Testing uses an open workload model in which clients are spawned at a defined rate. Arrival Phases are used to specify the rate at which clients are spawned, controlling the load progression of your test. They will determine how many clients will arrive at your targets during the test. You need at least one, but you can have as many phases as you wish.

Each phase has a duration (in seconds) and a rate (new clients per second). Additionally you can specify how many clients are allowed to launch during this phase using max_clients and give it a name with the name attribute. Note that the max_clients parameter specifies a limit on how many clients may be launched, not a target for the desired number of clients to launch. Note also that the max_clients setting can be used to mimic a closed workload model (footnote 1) in situations where that is desirable. The name is shown during the test-execution and can be used to describe the load, e.g. “100% base load” or “expected holiday sales traffic”.

definition.setArrivalPhases([
  {
    duration: 5 * 60,   // duration in seconds
    rate: 10,           // clients to launch per second
    max_clients: 100,   // optional: launch up to 100 clients in this phase
    name: "Warmup",     // optional: descriptive name for this phase (up to 32 characters)
    session_weights: {} // optional: see below
  },
]);

Each started client will pick one defined session and execute it, before it ends. See session likelihood for how to define this.

Note that the rate defined for a given arrival phase does not represent a constant, fixed rate or interval between client launches. The interval between client launches is drawn from an exponential probability distribution with a mean equal to the specified arrival rate. Because of this, the interval between consecutive client launches may not be predictable. However, over the course of a typical test run, the measured arrival rate will very closely approach or equal the specified rate. Note that very short test cases may show more variance in measured arrival rate due to limited sampling of the probability distribution.

When a test run ends, all active clients will be killed. Any active requests will be interrupted. These interrupted requests may be visible in the last seconds of the test run report.

Session Weights per Arrival Phase

Every session has a defined probability to be picked up by newly launched clients. The likelihood of each Session can be defined using weights per Arrival Phase via the session_weights field. If that is not present, if falls back to the session weights or probabilities set via setSessionWeights() and setSessionProbability() respectively. If that is not present, it just defaults to all sessions being of equal weight.

Example:

definition.setSessionWeights({
  "main": 100,
  "other": 1,
  "only warmup": 0,
})

definition.setArrivalPhases([
  {
    duration: 1 * 60,
    rate: 1,
    name: "warmup",
    session_weights: {
      "other": 2,
      "only warmup": 100,
    }
  },
  {
    duration: 2 * 60,
    rate: 2,
  },
  {
    duration: 2 * 60,
    rate: 3,
    session_weights: {
      "main": 1,
      // "other": 42, // missing sessions will be disabled
      "only warmup": 0, // weight of 0 deactivates the session
    }
  }
])

The definition above results in the following weights throughout the three test phases:

Phase main other only warmup
1 disabled 2 100
2 100 1 disabled
3 1 disabled disabled

Adding a Ramp Down Phase

If you want to give launched clients more time to finish their sessions, you can add another phase with a rate of zero:

definition.setArrivalPhases([
  { duration: 5 * 60, rate: 256, name: "warmup" },
  { duration: 20 * 60, rate: 1024, name: "main" },
  { duration: 2 * 60,  rate: 0, name: "ramp-down" },
]);

In this example the last phase will not start additional clients. Only active clients from previous phases will stay active until they reach the end of their sessions. If no more clients are active and no more clients can be started, we will end the test run early. See our FAQ entry for additional details.

Last modified June 22, 2023