Multiple UE4Scene GameServers in one container
Is your feature request related to a problem? Please describe. We are moving one Game to Agones achitecture, one single GameServer container internally needs to start multiple processes and they leverage share memory to reduce overall memory usage. If we deploy single process in a separate container, the overall memory is much higher than the "shared mode".
This deployment topology brings extra challenge to the agones architecture.
When upstream sends a GameAllocationRequest, in current design, we can not mark GameServer as Allocated because 1/n (Let's assume we start N servers in one container) is being used. Scheduling unit has been changed from pod level to process level.
Correspondingly, autoscaling logics have to be changed as well. It has to use signal like process request rate.
I am curious if community has seen similar use case, what's the best practice to deal with similar case?
Describe the solution you'd like N/A
Describe alternatives you've considered
We are in progress of changing topology and make one GS only container one UE4Scene. Still checking memory consumption changes. We think there's trade off between rich container vs single GS per container. But if the game team don't accept the refactoring, it's hard for us to use agones directly.
Additional context
This looks to be duplicate to: https://github.com/googleforgames/agones/issues/1239 which is coming in the next release (RC today likely).
If you don't want to rely on an Alpha feature, other people have put their own API in front of the allocation endpoint to track allocated gameservers and track the number of sessions available on each.
This looks to be duplicate to: #1239 which is coming in the next release (RC today likely).
Oh, Great. Hope to give it a try this week. Seems this proposal still concentrates on backfilling the allocated GameServer. Ours case is a little bit different. Processes in fat container use different ports. So it's hard to use allocation endpoint directly.
If you don't want to rely on an Alpha feature, other people have put their own API in front of the allocation endpoint to track allocated gameservers and track the number of sessions available on each.
I think this makes sense. We internally have similar component. With #1239 support + customized API, I think it should resolve our issue. Let me check the design and code changes and come back later on this.
Ours case is a little bit different. Processes in fat container use different ports. So it's hard to use allocation endpoint directly.
You can do that as well, each GameServer tracks it's own number of allowed concurrent sessions and puts it back into the pool for re-allocation when it's still available via label selectors (just remove the part about player capacity)
For example:
apiVersion: "allocation.agones.dev/v1"
kind: GameServerAllocation
spec:
preferred:
- matchLabels:
agones.dev/fleet: simple-udp
agones.dev/sdk-available: "true" # this is important
gameServerState: Allocated # new state filter: allocate from Allocated servers
required:
matchLabels:
agones.dev/fleet: simple-udp
gameServerState: Ready # Allocate out of the Ready Pool (which would be default, so backward compatible)
metadata:
labels:
agones.dev/sdk-available: "false" # this removes it from the pool
If you want to have seperate ports, this could be managed by exposing via an annotation which port is the current port to use when putting the GameServer back in the pool and that data could be retrievable from the GameServer after allocation is complete.
This is the last doc I need to write to complete the ticket.
We get some feedback from game team and notice they are using FGenericPlatformProcess::WaitAndFork to start multiple subprocess to save memory. Some of the scene server only serve two player. It's not worth to create a new one.
Do you know any agones users adopt the same UE4 deployment pattern and what's the best practice?
ref: https://docs.unrealengine.com/4.26/en-US/API/Runtime/Core/GenericPlatform/FGenericPlatformProcess/WaitAndFork/
I have exactly same problem depoying servers, since a emty UE server will occupy about 100M memory( I think there is a lot of static data loaded at bootage). For my game, if Fork can't be used then the memory occupication is not acceptable. About two years ago I have looked into Agones, and this is the issue preventing use Agones. Is there any Update for this issue?
@WenchaoXia see: https://agones.dev/site/docs/integration-patterns/high-density-gameservers/
It's currently in Alpha, but would love for you to take it for a spin, see if it fits your needs!
'This issue is marked as Stale due to inactivity for more than 30 days. To avoid being marked as 'stale' please add 'awaiting-maintainer' label or add a comment. Thank you for your contributions '
This issue is marked as obsolete due to inactivity for last 60 days. To avoid issue getting closed in next 30 days, please add a comment or add 'awaiting-maintainer' label. Thank you for your contributions