Skip to content

Load test a Knative HTTP service

Load test a Knative HTTP Service and validate SLOs

Use an Iter8 experiment to load test a Knative HTTP service and validate latency and error-related service level objectives (SLOs).

Before you begin
  1. Install Iter8.
  2. Install Knative and deploy your first Knative Service. As noted at the end of the Knative tutorial, when you curl the Knative service,
    you should see the expected output as follows.
    Hello World!
  3. Complete the Iter8 quick start tutorial.

1. Download experiment chart

Download the load-test experiment chart from Iter8 hub as follows.

iter8 hub -e load-test
cd load-test

2. Run experiment

The iter8 run command combines an experiment chart with the supplied values to generate the experiment.yaml file, runs the experiment, and writes results into the result.yaml file.

iter8 run --set url= \
          --set SLOs.error-rate=0 \
          --set SLOs.mean-latency=50 \
          --set SLOs.p90=100 \
          --set SLOs.p'97\.5'=200

3. Assert outcomes

Assert that the experiment completed without any failures and SLOs are satisfied.

iter8 assert -c completed -c nofailure -c slos

4. View report

View a report of the experiment in HTML or text formats as follows.

iter8 report -o html > report.html
# open report.html with a browser. In MacOS, you can use the command:
# open report.html
iter8 report -o text

Congratulations! 🎉 You completed your Iter8-Knative experiment.

Useful variations of this experiment
  1. Control the request generation process by setting the number of queries/duration of the load test, the number of queries sent per second during the test, and the number of parallel connections used to send requests.

  2. HTTP services with POST endpoints may accept payloads. Send various types of content as payload during the load test.

  3. Learn more about the built-in metrics that are collected and the SLOs that are validated during the load test.

  4. The values.yaml file in the experiment chart folder documents all the values that can be supplied during the experiment.

Back to top