Skip to content

Latest commit

 

History

History

load-test-http

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Load test, benchmark, and validate HTTP

This experiment generates requests for HTTP services, collects Iter8's built-in latency and error-related metrics, and validates service level objectives (SLOs).


Use-cases:

  • Load test
  • Benchmark
  • Validate service level objectives (SLOs)
  • Safe rollout
  • Continuous delivery (CD)

If the HTTP service satisfies SLOs, it may be safely rolled out, for example, from a test environment to production.


Basic example

Benchmark an HTTP service with a GET endpoint by specifying the url.

iter8 launch -c load-test-http --set url=https://httpbin.org/get

Metrics and SLOs

The following metrics are collected by default by this experiment:

  • http/request-count: total number of requests sent
  • http/error-count: number of error responses
  • http/error-rate: fraction of error responses
  • http/latency-mean: mean of observed latency values
  • http/latency-stddev: standard deviation of observed latency values
  • http/latency-min: min of observed latency values
  • http/latency-max: max of observed latency values
  • http/latency-pX: X-th percentile latency, for X in [50.0, 75.0, 90.0, 95.0, 99.0, 99.9]

Latency metrics have msec units. Any latency percentiles that are specified as part of SLOs are also collected.


--set SLOs.http/error-rate=0 \
--set SLOs.http/latency-mean=50 \
--set SLOs.http/latency-p90=100 \
--set SLOs.http/latency-p'97\.5'=200

In the above setting, the following SLOs will be validated.

  • error rate is 0
  • mean latency is under 50 msec
  • 90th percentile latency is under 100 msec
  • 97.5th percentile latency is under 200 msec

Load profile

Control the characteristics of the load generated by the load-test-http experiment by setting the number of queries (numQueries), duration (duration), the number of queries sent per second (qps), and the number of parallel connections used to send queries (connections).

Number of queries

--set numQueries=200 \
--set qps=10 \
--set connections=5

Refer to the values.yaml file which documents additional parameters related to the load profile such as duration.


Payload

Send any type of content as payload and specify the HTTP Content Type header. These options switch the HTTP method to POST.

String

Specify payload as a string. By default, its content type is set to application/octet-stream.

--set payloadStr="abc123"

String with contentType

--set payloadStr="abc123" \
--set contentType="text/plain"

JSON from URL

Fetch JSON content from a URL. Use this JSON as payload. Set content type to application/json.

--set payloadURL=https://data.police.uk/api/crimes-street-dates \
--set contentType="application/json"

Image from URL

Fetch jpeg image from a URL. Use this image as payload. Set content type to image/jpeg.

--set payloadURL=https://cdn.pixabay.com/photo/2021/09/08/17/58/poppy-6607526_1280.jpg \
--set contentType="image/jpeg"