|
| 1 | +# Load Test |
| 2 | +This test comes in two parts: |
| 3 | +1. Server - A simple "Hello World" HTTP server provided by Control Plane |
| 4 | +2. Client - A Cron workload used to run load tests against the server on demand. |
| 5 | + |
| 6 | +# How to Run the Load Test |
| 7 | +## Step 1: Create the client and server workloads |
| 8 | +To apply the server, run `cpln apply -f server.yaml --org {YOUR_ORG_NAME_HERE} --gvc load-test-server` |
| 9 | +To apply the client, run `cpln apply -f client.yaml --org {YOUR_ORG_NAME_HERE} --gvc load-test-client` |
| 10 | + |
| 11 | +## Step 2: Create one or more load test commands |
| 12 | +The workload in `client.yaml` (`load-test-cron`) is created in a suspended state, which means it will only run when commanded to. |
| 13 | +This can be done by creating a `command` object in the Control Plane API. To create your first command, run: |
| 14 | +`cpln rest post /org/{YOUR_ORG_HERE}/gvc/load-test-client/workload/load-test-cron/-command --file simple-command.yaml` |
| 15 | + |
| 16 | +This will begin a five-minute-long load test against the server workload. You can see the job execution in progress in the |
| 17 | +Control Plane Console. Navigate to the load-test-client gvc, click "Workloads" in the main navigation menu, click load-test-cron, and finally on "Job Executions". |
| 18 | +Note: the load test is only executing in the location specified in simple-command.yaml. To run a load test against all locations, you will need to create |
| 19 | +one command for each location. |
| 20 | + |
| 21 | +### Customize the load test command |
| 22 | +This test uses a powerful load testing tool called [k6](https://k6.io). So, optionally, you can override the load test command to change (among other things) |
| 23 | +- The number of virtual users |
| 24 | +- The duration of the test |
| 25 | +- The test script itself |
| 26 | + |
| 27 | +For an example, see `advanced-command.yaml` |
0 commit comments