← Workflows

阅读中文版本

Performance Test Strategy Workflow

Define load, stress, and soak tests with clear pass criteria so performance regressions are caught before release.

advanced~75 mintestingperformancestrategy

Objective

Establish a performance testing strategy with defined scenarios and pass criteria.

Environment

  • A load testing tool
  • A production-like environment
  • SLO targets

Steps

1. Define scenarios and targets

Specify load, stress, and soak scenarios with explicit pass thresholds from SLOs.

Expected state: Each test has a measurable pass criterion.

2. Run in a production-like environment

Execute against an environment with comparable capacity and data.

Expected state: Results reflect realistic conditions.

3. Compare against baseline

Compare each run with the previous baseline for latency and throughput.

Expected state: Regressions stand out against the baseline.

4. Gate release on criteria

Block release when pass criteria are not met.

Expected state: Performance regressions cannot ship silently.

Decision points

Production-like or small environment?

  • Production-like capacity
  • Small cheap environment

Test at production-like capacity; small environments hide bottlenecks.

Absolute or relative thresholds?

  • Relative to baseline
  • Absolute SLO only

Compare to baseline for regressions and also enforce SLO absolutes.

Expected outcome

Performance tests with clear criteria catch regressions before release.

Verification

Confirm a regression in latency or throughput fails the criteria and blocks release.

Cleanup

Refresh the baseline after intentional changes and archive run results.

Overview

Establish a performance testing strategy with defined scenarios and pass criteria.

This workflow is reusable across teams and environments; adapt the commands to your tooling while keeping the sequence and checkpoints intact.

Environment and prerequisites

  • A load testing tool
  • A production-like environment
  • SLO targets

Procedure

1. Define scenarios and targets

Specify load, stress, and soak scenarios with explicit pass thresholds from SLOs.

Expected state: Each test has a measurable pass criterion.

2. Run in a production-like environment

Execute against an environment with comparable capacity and data.

Expected state: Results reflect realistic conditions.

3. Compare against baseline

Compare each run with the previous baseline for latency and throughput.

Expected state: Regressions stand out against the baseline.

4. Gate release on criteria

Block release when pass criteria are not met.

Expected state: Performance regressions cannot ship silently.

# run a load scenario with pass criteria
 k6 run --vus 100 --duration 5m load.js --threshold 'http_req_duration{p(95)}<300'

Verification

Confirm a regression in latency or throughput fails the criteria and blocks release.

Decision points

Production-like or small environment?

  • Production-like capacity
  • Small cheap environment

Recommendation: Test at production-like capacity; small environments hide bottlenecks.

Absolute or relative thresholds?

  • Relative to baseline
  • Absolute SLO only

Recommendation: Compare to baseline for regressions and also enforce SLO absolutes.

Common failures

  • No criteria means results are not actionable.
  • Testing at small scale hides bottlenecks.
  • No baseline makes regressions invisible.