-
Notifications
You must be signed in to change notification settings - Fork 817
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changing the Dockerfile and the directories so that we have a single
image and a more flat sctucture.
- Loading branch information
Showing
7 changed files
with
30 additions
and
55 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
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 |
---|---|---|
@@ -1,34 +1,51 @@ | ||
# Load Testing | ||
# Load and performance tests | ||
|
||
Load tests aim to test the performance of the system under heavy load. Game server allocation is an example where multiple parallel operations should be tested. | ||
Load tests aim to test the performance of the system under heavy load. For Agones, game server allocation is an example where heavy load and multiple parallel operations can be envisioned. Locust provides a good framework for testing a system under heavy load. It provides a light-weight mechanism to launch thousands of workers that run a given test. | ||
|
||
## Build and run test | ||
The goal of performance tests is to provide metrics on various operations. For | ||
Agones, fleet scaling is a good example where performance metrics are useful. | ||
Similar to laod tests, Locust can be used for performance tests with the main | ||
difference being the number of workers that are launched. | ||
|
||
## Build and run tests | ||
|
||
Prerequisites: | ||
- Docker. | ||
- A running k8s cluster. | ||
- Have kubeconfig file ready. | ||
|
||
Load tests are written using Locust. These tests are also integrated with Graphite and Grafana | ||
for storage and visualization of the results. | ||
|
||
### Running Load tests using Locust on your local machine | ||
### Running load tests using Locust on your local machine | ||
|
||
Start a proxy to the Kubernetes API server: | ||
This test uses the HTTP proxy on the local machine to access the k8s API. The default port for the proxy is 8001. To start a proxy to the Kubernetes API | ||
server: | ||
|
||
``` | ||
kubectl proxy [--port=PORT] & | ||
``` | ||
|
||
The default port for the proxy is 8001. | ||
Next, we need to build the Docker images and run the container: | ||
|
||
``` | ||
docker build -t locust-files . | ||
docker run --rm --network="host" -e "TARGET_HOST=http://127.0.0.1:8001" locust-files:latest | ||
``` | ||
|
||
The above will build a Docker container to install Locust, Grafana, and Graphite and will configure | ||
them. The test uses the HTTP proxy on the local machine to access the k8s API. | ||
them. To run Locust tests for game server allocation: | ||
|
||
``` | ||
docker run --rm --network="host" -e "LOCUST_FILE=gameserver_allocation.py -e "TARGET_HOST=http://127.0.0.1:8001" locust-files:latest | ||
``` | ||
|
||
To run Locust tests for fleet autoscaling: | ||
|
||
``` | ||
docker run --rm --network="host" -e "LOCUST_FILE=fleet_autoscaling.py -e "TARGET_HOST=http://127.0.0.1:8001" locust-files:latest | ||
``` | ||
|
||
NOTE: The Docker network host only works for Linux. For macOS and Windows you can use the special DNS name host.docker.internal. | ||
|
||
After running the Docker container you can access Locust on port 8089 of your local machine. When running Locust tests, it is recommended to use the same value for number of users and hatch rate. For game server allocation, these numbers can be large, but for fleet autoscaling a single user is sufficient. | ||
|
||
After running the Docker container you can access Locust on port 8089 of your local machine. | ||
Grafana will be available on port 80, and Graphite on port 81. | ||
Grafana will be available on port 80, and Graphite on port 81. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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