Skip to content

Commit

Permalink
Enhanced GS allaocation performance but replacing sync cache call wit…
Browse files Browse the repository at this point in the history
…h local cache.

Fixes #535
  • Loading branch information
ilkercelikyilmaz committed Feb 27, 2019
1 parent 764fa53 commit e183529
Show file tree
Hide file tree
Showing 9 changed files with 431 additions and 75 deletions.
2 changes: 1 addition & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ GO_BUILD_TAGS ?= none

# Specify stress test level 1..100
# STRESS_TEST_LEVEL=n requires capacity between 50*n up to 100*n simple-udp Game Servers.
STRESS_TEST_LEVEL=20
STRESS_TEST_LEVEL ?= 20

# kind cluster name to use
KIND_PROFILE ?= agones
Expand Down
2 changes: 1 addition & 1 deletion build/gke-test-cluster/cluster.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ resources:
- name: "agones-system"
initialNodeCount: 1
config:
machineType: n1-standard-2
machineType: n1-standard-4
oauthScopes:
- https://www.googleapis.com/auth/compute
- https://www.googleapis.com/auth/devstorage.read_only
Expand Down
7 changes: 5 additions & 2 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ const (
logSizeLimitMBFlag = "log-size-limit-mb"
kubeconfigFlag = "kubeconfig"
defaultResync = 30 * time.Second
// topNGSForAllocation is used by the GameServerAllocation controller
// to reduce the contention while allocating gameservers.
topNGSForAllocation = 100
)

var (
Expand Down Expand Up @@ -187,8 +190,8 @@ func main() {
fleetController := fleets.NewController(wh, health, kubeClient, extClient, agonesClient, agonesInformerFactory)
faController := fleetallocation.NewController(wh, allocationMutex,
kubeClient, extClient, agonesClient, agonesInformerFactory)
gasController := gameserverallocations.NewController(wh, health, allocationMutex, kubeClient,
kubeInformerFactory, extClient, agonesClient, agonesInformerFactory)
gasController := gameserverallocations.NewController(wh, health, kubeClient,
kubeInformerFactory, extClient, agonesClient, agonesInformerFactory, topNGSForAllocation)
fasController := fleetautoscalers.NewController(wh, health,
kubeClient, extClient, agonesClient, agonesInformerFactory)

Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/stable/v1alpha1/gameserverallocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const (
GameServerAllocationAllocated GameServerAllocationState = "Allocated"
// GameServerAllocationUnAllocated when the allocation is unsuccessful
GameServerAllocationUnAllocated GameServerAllocationState = "UnAllocated"
// GameServerAllocationContention when the allocation is unsuccessful
// because of contention
GameServerAllocationContention GameServerAllocationState = "Contention"
)

// GameServerAllocationState is the Allocation state
Expand Down
Loading

0 comments on commit e183529

Please sign in to comment.