When i build my project, i dont see any “Dedicated Server” option.
So when i launch it on server as an authorative host, it loads too much content, i am not sure, but i think it also loads Materials, Textures, Sounds for scene etc.
So, simple multiplayer scene with single Plane and Cube, takes about ~50MB of memory and it grows after time to ~100MB. That is too much, because i want to launch 100+ of such dedicated servers on single machine.
How to reduce memory usage for multiplayer server/authorative host? How to not load Materials, Textures, Sounds etc…? for GameObjects on scene, if i run “Authorative/Dedicated Server”.
EDIT1:
launching with commandline: -batchmode -nographics helped a lot.
Now i have another problem, it still has 40+ threads per server, i wonder for what so much. And also it consumes 2% of processor when totally idle.
Another Question:
I am making session based game, maybe i can somehow handle multiple sessions by single Dedicated Server, without running separate server per every session? Is it possible with UNET? i dont know yet.
We are supposed to get a dedicated server library for uNet in one of the next Unity versions. This is the most important uNet update we’re all waiting for.
Until then, it’s a case of using what we have. uNet uses about 50Mb of memory straight away, I presume this is message memory caching/pooling. If it’s still growing, that’s a memory leak and probably needs reporting as a bug. To preserve resources, I remove all renderers from objects, and don’t load materials or textures.
I don’t think you’ll be able to run 100+ servers on a single machine; that just doesn’t sound reasonable.
Why have you got 40 threads? Is that per unity instance server, or are you running multiple unity servers?
Every server will handle 10 players (5v5), 100 servers = 1000 players, i think that should be reasonable for single machine.
It’s just single unity server (application). 40 threads per every application copy. I donno why.
With -batchmode -nographics, application eats 24MB, much better actually, but it should be much lesser i suppose.
Question:
I am making session based game, maybe i can somehow handle multiple sessions by single Dedicated Server, without running separate server per every session? Is it possible with UNET? i dont know yet.
I don’t mean to ask an unrelated question, but if you don’t mind, how do you allow players to connect to your server? I’ve read that you can’t right now unless you require other players to port forward?
newbiprofi2: As far as being having that many servers on a single machine, that will depend on how much resources a single one of your servers will need to be performant at peak load.
foxifi: You need to make sure there is an external IP/Port that is associated with your game server for players to be able to access it. If your game is behind a router, then yes, you will need to have some form of port forwarding to route the client packets to the game server.