Skip to content

Load Test Multiple gRPC methods

Load Test gRPC with SLOs describes how to load test a single method from a gRPC service inside Kubernetes. This tutorial expands on the previous tutorial and describes how to load test multiple endpoints from an HTTP service.

load-test-grpc


Before you begin
  1. Try your first experiment. Understand the main concepts behind Iter8 experiments.
  2. Deploy the sample gRPC service in the Kubernetes cluster.
    kubectl create deployment routeguide --image=golang --port=50051 \
    -- bash -c "git clone -b v1.52.0 --depth 1 https://github.com/grpc/grpc-go; cd grpc-go/examples/route_guide; sed -i '' 's/localhost//' server/server.go; go run server/server.go"
    kubectl expose deployment routeguide --port=50051
    

Launch experiment

iter8 k launch \
--set "tasks={ready,grpc,assess}" \
--set ready.deploy=routeguide \
--set ready.service=routeguide \
--set ready.timeout=60s \
--set grpc.host=routeguide.default:50051 \
--set grpc.protoURL=https://raw.githubusercontent.com/grpc/grpc-go/v1.52.0/examples/route_guide/routeguide/route_guide.proto \
--set grpc.endpoints.getFeature.call=routeguide.RouteGuide.GetFeature \
--set grpc.endpoints.getFeature.dataURL=https://raw.githubusercontent.com/iter8-tools/docs/v0.13.13/samples/grpc-payload/unary.json \
--set grpc.endpoints.listFeatures.call=routeguide.RouteGuide.ListFeatures \
--set grpc.endpoints.listFeatures.dataURL=https://raw.githubusercontent.com/iter8-tools/docs/v0.13.13/samples/grpc-payload/server.json \
--set assess.SLOs.upper.grpc-getFeature/error-rate=0 \
--set assess.SLOs.upper.grpc-getFeature/latency/mean=50 \
--set assess.SLOs.upper.grpc-listFeatures/error-rate=0 \
--set assess.SLOs.upper.grpc-listFeatures/latency/mean=100 \
--set runner=job
About this experiment

This experiment consists of three tasks, namely, ready, grpc, and assess.

The ready task checks if the routeguide deployment exists and is available, and the routeguide service exists.

The grpc task sends call requests to two methods of the cluster-local gRPC service, and collects Iter8's built-in gRPC load test metrics. The two methods are routeguide.RouteGuide.GetFeature and routeguide.RouteGuide.ListFeatures. Note that each method also has its own dataURL for the request payload.

The assess task verifies if each method satisfies their respective error rate and mean latency SLOs. Both methods must have an error rate of 0 but the getFeature and listFeatures methods are allowed a maximum mean latency of 50 and 100 msecs, respectively.

This is a single-loop Kubernetes experiment where all the previously mentioned tasks will run once and the experiment will finish. Hence, its runner value is set to job.

Some variations and extensions of this experiment
  1. The grpc task can be configured with load related parameters such as the total number of requests, requests per second, or number of concurrent connections.
  2. The assess task can be configured with SLOs for any of Iter8's built-in grpc load test metrics.

Assert experiment outcomes, view experiment report, view experiment logs, and cleanup as described in your first experiment.


Cleanup

Remove the Iter8 experiment and the sample app from the Kubernetes cluster and the local Iter8 charts folder.

iter8 k delete
kubectl delete svc/routeguide
kubectl delete deploy/routeguide