Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple UE4Scene GameServers in one container #2235

Closed
Jeffwan opened this issue Aug 25, 2021 · 8 comments
Closed

Multiple UE4Scene GameServers in one container #2235

Jeffwan opened this issue Aug 25, 2021 · 8 comments
Labels
kind/feature New features for Agones obsolete stale Pending closure unless there is a strong objection.

Comments

@Jeffwan
Copy link
Contributor

Jeffwan commented Aug 25, 2021

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

@Jeffwan Jeffwan added the kind/feature New features for Agones label Aug 25, 2021
@markmandel
Copy link
Member

This looks to be duplicate to: #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.

@Jeffwan
Copy link
Contributor Author

Jeffwan commented Aug 25, 2021

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.

@markmandel
Copy link
Member

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.

@Jeffwan
Copy link
Contributor Author

Jeffwan commented Aug 27, 2021

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/

@WenchaoXia
Copy link

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?

@markmandel
Copy link
Member

@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!

@github-actions
Copy link

github-actions bot commented Oct 1, 2023

'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 '

@github-actions github-actions bot added the stale Pending closure unless there is a strong objection. label Oct 1, 2023
Copy link

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

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New features for Agones obsolete stale Pending closure unless there is a strong objection.
Projects
None yet
Development

No branches or pull requests

3 participants