Load Options

This is a walkthrough of different load options available to control the rate in requests per second (RPS) that ghz attempts to make to the server. All examples are done using a simple unary gRPC call.

Constant RPS

  1. ghz --insecure --async \
  2. --proto /protos/helloworld.proto \
  3. --call helloworld.Greeter/SayHello \
  4. -c 10 -n 10000 --rps 200 \
  5. -d '{"name":"{{.WorkerID}}"}' 0.0.0.0:50051
  6. Summary:
  7. Count: 10000
  8. Total: 50.05 s
  9. Slowest: 56.17 ms
  10. Fastest: 50.17 ms
  11. Average: 50.58 ms
  12. Requests/sec: 199.79
  13. Response time histogram:
  14. 50.167 [1] |
  15. 50.768 [8056] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  16. 51.368 [1900] |∎∎∎∎∎∎∎∎∎
  17. 51.968 [37] |
  18. 52.568 [1] |
  19. 53.169 [0] |
  20. 53.769 [0] |
  21. 54.369 [1] |
  22. 54.969 [1] |
  23. 55.569 [0] |
  24. 56.170 [3] |
  25. Latency distribution:
  26. 10 % in 50.32 ms
  27. 25 % in 50.40 ms
  28. 50 % in 50.56 ms
  29. 75 % in 50.72 ms
  30. 90 % in 50.88 ms
  31. 95 % in 51.00 ms
  32. 99 % in 51.23 ms
  33. Status code distribution:
  34. [OK] 10000 responses

This will perform a constant load RPS against the server. Graphed, it may look like this:

Constant Load

Step Up RPS

  1. ghz --insecure --async --proto /protos/helloworld.proto \
  2. --call helloworld.Greeter/SayHello \
  3. -c 10 -n 10000 \
  4. --load-schedule=step --load-start=50 --load-end=150 --load-step=10 --load-step-duration=5s \
  5. -d '{"name":"{{.WorkerID}}"}' 0.0.0.0:50051
  6. Summary:
  7. Count: 10000
  8. Total: 85.05 s
  9. Slowest: 60.16 ms
  10. Fastest: 50.18 ms
  11. Average: 51.10 ms
  12. Requests/sec: 117.57
  13. Response time histogram:
  14. 50.181 [1] |
  15. 51.179 [5713] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  16. 52.177 [3923] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  17. 53.174 [311] |∎∎
  18. 54.172 [46] |
  19. 55.170 [0] |
  20. 56.168 [1] |
  21. 57.166 [1] |
  22. 58.164 [2] |
  23. 59.161 [0] |
  24. 60.159 [2] |
  25. Latency distribution:
  26. 10 % in 50.48 ms
  27. 25 % in 50.68 ms
  28. 50 % in 51.07 ms
  29. 75 % in 51.41 ms
  30. 90 % in 51.68 ms
  31. 95 % in 52.02 ms
  32. 99 % in 52.77 ms
  33. Status code distribution:
  34. [OK] 10000 responses

Performs step load starting at 50 RPS and inscreasing by 10 RPS every 5s until we reach 150 RPS at which point the load is sustained at constant RPS rate until we reach 10000 total requests. The RPS load is distributed among the 10 workers, all sharing 1 connection.

Step Up Load

Step Down RPS

  1. ghz --insecure --async --proto /protos/helloworld.proto \
  2. --call helloworld.Greeter/SayHello \
  3. -c 10 -n 10000 \
  4. --load-schedule=step --load-start=200 --load-step=-10 --load-step-duration=5s --load-max-duration=40s \
  5. -d '{"name":"{{.WorkerID}}"}' 0.0.0.0:50051
  6. Summary:
  7. Count: 10000
  8. Total: 68.38 s
  9. Slowest: 55.88 ms
  10. Fastest: 50.16 ms
  11. Average: 50.85 ms
  12. Requests/sec: 146.23
  13. Response time histogram:
  14. 50.159 [1] |
  15. 50.730 [4367] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  16. 51.302 [4281] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  17. 51.874 [1304] |∎∎∎∎∎∎∎∎∎∎∎∎
  18. 52.446 [43] |
  19. 53.018 [0] |
  20. 53.590 [0] |
  21. 54.162 [2] |
  22. 54.734 [0] |
  23. 55.306 [0] |
  24. 55.877 [2] |
  25. Latency distribution:
  26. 10 % in 50.45 ms
  27. 25 % in 50.60 ms
  28. 50 % in 50.77 ms
  29. 75 % in 51.06 ms
  30. 90 % in 51.38 ms
  31. 95 % in 51.54 ms
  32. 99 % in 51.79 ms
  33. Status code distribution:
  34. [OK] 10000 responses

Performs step load starting at 200 RPS and decreasing by 10 RPS every 10s until 40s has elapsed at which point the load is sustained at that RPS rate until we reach 10000 total requests. The RPS load is distributed among the 10 workers, all sharing 1 connection.

Step Down Load

Linear load

  1. ghz --insecure --async --proto /protos/helloworld.proto \
  2. --call helloworld.Greeter/SayHello \
  3. -c 10 -n 10000 \
  4. --load-schedule=line --load-start=5 --load-step=5 \
  5. -d '{"name":"{{.WorkerID}}"}' 0.0.0.0:50051
  6. Summary:
  7. Count: 10000
  8. Total: 62.80 s
  9. Slowest: 56.61 ms
  10. Fastest: 50.19 ms
  11. Average: 50.72 ms
  12. Requests/sec: 159.24
  13. Response time histogram:
  14. 50.189 [1] |
  15. 50.832 [7552] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  16. 51.474 [1781] |∎∎∎∎∎∎∎∎∎
  17. 52.117 [405] |∎∎
  18. 52.759 [139] |∎
  19. 53.402 [42] |
  20. 54.044 [28] |
  21. 54.687 [28] |
  22. 55.329 [10] |
  23. 55.972 [13] |
  24. 56.614 [1] |
  25. Latency distribution:
  26. 10 % in 50.34 ms
  27. 25 % in 50.42 ms
  28. 50 % in 50.57 ms
  29. 75 % in 50.82 ms
  30. 90 % in 51.22 ms
  31. 95 % in 51.68 ms
  32. 99 % in 53.16 ms
  33. Status code distribution:
  34. [OK] 10000 responses

Performs linear load starting at 5 RPS and increasing by 5 RPS every 1s until we reach 10000 total requests. The RPS load is distributed among the 10 workers, all sharing 1 connection.

Linear Up Load

Linear load decrease

  1. ghz --insecure --async --proto /protos/helloworld.proto \
  2. --call helloworld.Greeter/SayHello \
  3. -c 10 -n 10000 \
  4. --load-schedule=line --load-start=200 --load-step=-2 --load-end=100 \
  5. -d '{"name":"{{.WorkerID}}"}' 0.0.0.0:50051
  6. Summary:
  7. Count: 10000
  8. Total: 74.55 s
  9. Slowest: 83.20 ms
  10. Fastest: 50.18 ms
  11. Average: 50.89 ms
  12. Requests/sec: 134.13
  13. Response time histogram:
  14. 50.183 [1] |
  15. 53.486 [9989] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  16. 56.788 [5] |
  17. 60.090 [1] |
  18. 63.392 [3] |
  19. 66.694 [0] |
  20. 69.996 [0] |
  21. 73.298 [0] |
  22. 76.600 [0] |
  23. 79.902 [0] |
  24. 83.205 [1] |
  25. Latency distribution:
  26. 10 % in 50.42 ms
  27. 25 % in 50.57 ms
  28. 50 % in 50.77 ms
  29. 75 % in 51.11 ms
  30. 90 % in 51.49 ms
  31. 95 % in 51.73 ms
  32. 99 % in 52.15 ms
  33. Status code distribution:
  34. [OK] 10000 responses

Performs linear load starting at 200 RPS and decreasing by 2 RPS every 1s until we reach 100 RPS at which point a constant rate is sustained until we accumulate 10000 total requests. The RPS load is distributed among the 10 workers, all sharing 1 connection.

Linear Down Load