Chapter 38: Load Testing and Benchmarking

ghz — gRPC Load Testing Tool

# Install
$ go install github.com/bojand/ghz/cmd/ghz@latest

# Run load test: 10000 requests, 50 concurrent
$ ghz --insecure --proto service.proto \
    --call mypackage.MyService/GetUser \
    -d '{"user_id":"123"}' \
    -n 10000 -c 50 \
    localhost:50051

# Output: QPS, latency percentiles, error rate

Key Metrics from Load Tests