Skip to content

Commit

Permalink
maint: add setup for load testing (#143)
Browse files Browse the repository at this point in the history
## 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
3 people committed Sep 6, 2023
1 parent 15ddb0f commit abb7985
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
43 changes: 43 additions & 0 deletions smoke-tests/echoserver.yaml
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
30 changes: 30 additions & 0 deletions smoke-tests/loadtest.md
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
```
12 changes: 12 additions & 0 deletions smoke-tests/locustfile.py
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))

0 comments on commit abb7985

Please sign in to comment.