Skip to content

Commit

Permalink
Batched Packed and Distributed Allocations (#804)
Browse files Browse the repository at this point in the history
* Batched Packed and Distributed Allocations

This implements a batching algorithm for Packed and Distributed
GameServerAllocations (GSA).

This ensures that we can still get high throughout on GSA's, while
retaining a tight packing of Allocated GameServers on each node with
the Packed strategy.

The Distributed strategy is now implemented with a randomised Allocation
process, so ensure distributed load under this strategy.

Closes #783

* Move updateQueue into allocationUpdateWorkers.

* Add large explanatory code block.
  • Loading branch information
markmandel authored Jun 12, 2019
1 parent e750bfe commit 8e40cd2
Show file tree
Hide file tree
Showing 5 changed files with 894 additions and 450 deletions.
7 changes: 7 additions & 0 deletions pkg/gameserverallocations/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,10 @@ func (e *gameServerCacheEntry) Range(f func(key string, gs *stablev1alpha1.GameS
}
}
}

// Len returns the current length of the cache
func (e *gameServerCacheEntry) Len() int {
e.mu.RLock()
defer e.mu.RUnlock()
return len(e.cache)
}
Loading

0 comments on commit 8e40cd2

Please sign in to comment.