generated from honeycombio/.github
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
maint: add setup for load testing (#143)
## Which problem is this PR solving? easy setup for load testing ## Short description of the changes - Add [echoserver](https://hub.docker.com/r/ealen/echo-server) as Kubernetes deployment to use with Locustfile ## How to verify that this has the expected result Follow instructions in the loadtest doc ![loadtestinhoneycomb](https://github.com/honeycombio/honeycomb-ebpf-agent/assets/29520003/468b2113-3f6f-4830-a216-bbd802e79aaf) --------- Co-authored-by: Vera Reynolds <vreynolds@users.noreply.github.com> Co-authored-by: Mike Goldsmith <goldsmith.mike@gmail.com>
- Loading branch information
1 parent
15ddb0f
commit abb7985
Showing
3 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: echoserver | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: echoserver | ||
namespace: echoserver | ||
spec: | ||
replicas: 5 | ||
selector: | ||
matchLabels: | ||
app: echoserver | ||
template: | ||
metadata: | ||
labels: | ||
app: echoserver | ||
spec: | ||
containers: | ||
- image: ealen/echo-server:latest | ||
imagePullPolicy: IfNotPresent | ||
name: echoserver | ||
ports: | ||
- containerPort: 80 | ||
env: | ||
- name: PORT | ||
value: "80" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: echoserver | ||
namespace: echoserver | ||
spec: | ||
selector: | ||
app: echoserver | ||
ports: | ||
- name: http | ||
port: 80 | ||
targetPort: 80 | ||
type: LoadBalancers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Load Testing | ||
|
||
1. Deploy echo server | ||
|
||
```shell | ||
k apply -f echoserver.yaml | ||
``` | ||
|
||
2. Build & deploy agent | ||
|
||
```shell | ||
make docker-build | ||
HONEYCOMB_API_KEY=abc make apply-ebpf-agent | ||
``` | ||
|
||
3. Start load test | ||
|
||
```shell | ||
locust | ||
``` | ||
|
||
4. Run load test with 5-6k concurrent users at 100 users/s ramp up. It's not always going to get messed up, but when it does it will usually happen within a minute or two of starting the load test. | ||
|
||
5. Watch the data in Honeycomb. You can tell when the matching starts to break down. You can see it in Honeycomb on a duration heatmap (it starts to first get much larger than average, and then goes negative). | ||
|
||
6. Tear down echo server | ||
|
||
```shell | ||
k delete -f echoserver.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import time, random | ||
from locust import HttpUser, task, between | ||
|
||
|
||
class QuickstartUser(HttpUser): | ||
host = "http://localhost:80" | ||
wait_time = between(1, 2) | ||
|
||
@task | ||
def hello_greeting(self): | ||
i = random.randrange(1, 10) | ||
self.client.get("/?echo_body=" + str(i)) |