Skip to content

Commit d749f63

Browse files
vicentefbgongmax
andauthored
Improve documentation to run performance script (googleforgames#3948)
* Improve documentation to run performance script * documentation * addressed comments * referenced links more * documentation improvement --------- Co-authored-by: Mengye (Max) Gong <[email protected]>
1 parent 655e340 commit d749f63

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

build/README.md

+77
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ Table of Contents
105105
* [make kind-shell](#make-kind-shell)
106106
* [make kind-controller-portforward](#make-kind-controller-portforward)
107107
* [Dependencies](#dependencies)
108+
* [Running Performance Test](#running-performance-test)
108109
* [Troubleshooting](#troubleshooting)
109110
* [$GOPATH/$GOROOT error when building in WSL](#gopathgoroot-error-when-building-in-wsl)
110111
* [Error: cluster-admin-binding already exists](#error-cluster-admin-binding-already-exists)
@@ -895,6 +896,82 @@ Note the version in the pathname. Go may eliminate the need to do this in future
895896

896897
We also use vendor to hold code patches while waiting for the project to release the fixes in their own code. An example is in [k8s.io/apimachinery](https://github.com/googleforgames/agones/issues/414) where a fix will be released later this year, but we updated our own vendored version in order to fix the issue sooner.
897898

899+
## Running Performance Test
900+
901+
To be able to run the performance script located in the following path: `agones/build/performance-test.sh` you need to have the following setup:
902+
903+
#### Install a standard GKE cluster
904+
905+
Follow for more details here: https://agones.dev/site/docs/installation/creating-cluster/gke/
906+
907+
#### Install Agones
908+
909+
Follow for more details here: https://agones.dev/site/docs/installation/install-agones/helm/
910+
911+
#### Set up node for prometheus
912+
913+
```
914+
gcloud container node-pools create agones-metrics --cluster={CLUSTER_NAME} --zone={REGION} \
915+
--node-taints agones.dev/agones-metrics=true:NoExecute \
916+
--node-labels agones.dev/agones-metrics=true \
917+
--num-nodes=1 \
918+
--machine-type=e2-standard-4
919+
```
920+
921+
#### Install Prometheus, Grafana and port-forward
922+
923+
cd agones/
924+
925+
https://agones.dev/site/docs/guides/metrics/#installation
926+
927+
#### Modify the performance-test.sh
928+
929+
The performance-tests script contains a set of variables that need to be overwritten to work with your cluster and configuration settings. You can also pass these values through command line This is an example:
930+
931+
```
932+
CLUSTER_NAME=agones-standard
933+
CLUSTER_LOCATION=us-central1-c
934+
REGISTRY=us-east1-docker.pkg.dev/user/agones
935+
PROJECT=my-project
936+
REPLICAS=10000
937+
AUTO_SHUTDOWN_DELAY=60
938+
BUFFER_SIZE=9900
939+
MAX_REPLICAS=20000
940+
DURATION=10m
941+
CLIENTS=50
942+
INTERVAL=1000
943+
```
944+
945+
You might also want to comment out the first couple lines that come after the variables are set and also change the cd directoy:
946+
947+
```
948+
# export SHELL="/bin/bash"
949+
# mkdir -p /go/src/agones.dev/
950+
# ln -sf /workspace /go/src/agones.dev/agones
951+
# cd /go/src/agones.dev/agones/build
952+
953+
# gcloud config set project $PROJECT
954+
# gcloud container clusters get-credentials $CLUSTER_NAME \
955+
# --zone=$CLUSTER_LOCATION --project=$PROJECT
956+
957+
# make install LOG_LEVEL=info REGISTRY='"'$REGISTRY'"' DOCKER_RUN=""
958+
959+
# cd /go/src/agones.dev/agones/test/load/allocation
960+
cd ../test/load/allocation
961+
```
962+
963+
This script is an entyrpoint to be able to run the allocation performance test which can be found at `agones/test/load/allocation`
964+
965+
You can see the fleet and autoscaler configuration (such as buffer size and min/max replicas, etc) in the following files:
966+
967+
* [performance-test-fleet-template](https://github.com/googleforgames/agones/blob/main/test/load/allocation/performance-test-fleet-template.yaml)
968+
* [performance-test-autoscaler-template.yaml](https://github.com/googleforgames/agones/blob/main/test/load/allocation/performance-test-autoscaler-template.yaml)
969+
970+
You could also modify the `automatic shutdown delay` parameter where if the value is greater than zero, it will automatically shut down the server this many seconds after the server becomes allocated (cannot be used if `automaticShutdownDelayMin` is set). It's a configuration for the simple game server.
971+
972+
Something to keep in mind with CLIENTS and INTERVAL is the following. Let's say you have client count 50 and interval 500ms, which means every client will submit 2 allocation requests in 1s, so the entire allocation requests that the allocator receives in 1s is 50 * 2 = 100, so the allocation request QPS from the allocator view is 100.
973+
974+
Finally, you can cd agones/build and run `sh performance-test.sh` if you see timeout issues please re-run the command.
898975

899976
## Troubleshooting
900977

0 commit comments

Comments
 (0)