Multiple game instances in one server executable

Hi,
I’m trying to develop a match-based game and I believe the standard is to have multiple matches run inside the same server executable for performance. These matches run on basically identical logic but should be isolated from one another.

As this post points out multiple server worlds seem to work perfectly fine. But I’m wondering if this is intended.

Also, considering the way ECS works, would it be more performant to have all matches in the same server world, and have them be separated by physics worlds + ghost relevancy? As far as I know, this allows entities from all matches to share the same archetypes and lets a single system operate on all matches, which should improve server performance relative to having multiple worlds.

Is this true and is there anything I’m missing regarding the implementation of a match-stacking system?

Cheers :slight_smile:

1 Like

Hey rezonabyt!

It’s not supported in the sense that we don’t test to ensure this works, but if it works, then feel free to use it!

We will consider adding official support for this feature (in editor, at the very least), as it overlaps with another feature we’re thinking about, but I can’t be any more specific than that unfortunately.

With that said, my understanding is that it’s better practice to run multiple instances of the executable on a server instance, rather than having one that spools up and down. This is to isolate failures (like crashes and CPU stalls).

Let us know how you get on with it, as it does sound useful.

Are there currently efforts being made to reduce the base cost of a running instance?

currently having multiple worlds inside one instance would consume a lot less resources compared to one executable per world.

Especially if each instance only hosts very few players (2-3).

if the server resource cost (cpu & ram) for multi world vs multi instance are close that would of course be ideal.

1 Like

I believe so. The Dedicated Server Build Target is still being improved AFAIK:
https://discussions.unity.com/t/849053
You may have better luck with this query posting in that Multiplayer sub-forum.

Agreed. I’ll ask for someone who knows more to reply.

2 Likes

Hello!

Yes! we are continuously working on improving the Dedicated Server as a platform.

I agree, in that thread Niki mentioned we shared that some initial results showed a memory reduction of up to 60% for some sample projects . That was a big first step and we continue investigating more ways to optimize cost, performance and workflow.

3 Likes