From 1f125775b2ce1296158225ce6c1ca96a0dc6cc87 Mon Sep 17 00:00:00 2001 From: Aaron Wislang Date: Tue, 16 Jul 2019 12:34:05 -0700 Subject: [PATCH] Add hey, other tweaks --- slides/k8s/horizontal-pod-autoscaler.md | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/slides/k8s/horizontal-pod-autoscaler.md b/slides/k8s/horizontal-pod-autoscaler.md index 26edd4d5..966f7199 100644 --- a/slides/k8s/horizontal-pod-autoscaler.md +++ b/slides/k8s/horizontal-pod-autoscaler.md @@ -120,19 +120,19 @@ ## Send traffic to the service -- We will use `ab` (Apache Bench) to send traffic +- We will use [hey](https://github.com/rakyll/hey/releases) to send traffic .exercise[ -- Send a lot of requests to the service, with a concurrency level of 3: +- Send a lot of requests to the service with a concurrency level of 3: ```bash - ab -c 3 -n 100000 http://`ClusterIP`/ + curl https://storage.googleapis.com/jblabs/dist/hey_linux_v0.1.2 > hey + chmod +x hey + ./hey http://localhost:8080 -c 3 -n 200 ``` ] -The latency (reported by `httping`) should increase above 3s. - The CPU utilization should increase to 100%. (The server is single-threaded and won't go above 100%.) @@ -164,7 +164,7 @@ This can also be set with `--cpu-percent=`. ## What did we miss? -- The events stream gives us a hint, but to be honest, it's not very clear: +- The events stream (`kubectl get events -w`) gives us a hint, but to be honest, it's not very clear: `missing request for cpu` @@ -190,13 +190,9 @@ This can also be set with `--cpu-percent=`. ``` - In the `containers` list, add the following block: - ```yaml - resources: - requests: - cpu: "1" - memory: 64Mi ``` - + resources: {"requests":{"cpu":"1", "memory":"64Mi"} + ``` ] --- @@ -205,7 +201,7 @@ This can also be set with `--cpu-percent=`. - After saving and quitting, a rolling update happens - (if `ab` exits, make sure to restart it) + (if `hey` exits, make sure to restart it) - It will take a minute or two for the HPA to kick in: