I’m developing a game where I do not care about how many clients are connected (it is just for fun and to learn about networking) so I wanted to set the maxConnections to the highest value possible.
However, I do not know if it can affect the performance or the internal functionality in any way.
The documentation says that changing the value “effects the memory usage of the network layer” but it does not say in which way.
I get that having 1000 CCU will be stressful, but if I have the limit set to a 1000 and there are only 4-5 CCU will it be bad it any way (like reserving memory, doing unnecessary work, …)?
Mirror is a fork of Unet, and Unet used the max connections setting to basically pre-allocate all resources (memory) that it may ever need when the maximum number of connections are active. In my own testing Unet would allocate several gigabytes of memory as soon as the server comes up when configured for 1k connections.
Mirror though uses an entirely different transport, not based on the original used by the Unet LLAPI, and can be configured to use one of several transports. I’d be a bit surprised if they followed the same memory pre-allocation behavior as original Unet.
Should increase the number of max connections to really high values and check the change memory usage in runtime show if they disabled the memory preallocation?
That would be my assumption. I first noticed the issue with Unet with just the “top” command where it says percentage of memory usage after I changed only the max connections value between builds.
New here! Using Mirror.
What happens if the maximum connection is reached in a single room ?
I’m struggling understanding how the server reacts to it ?
I would like the server to create new instances of the game everytime the max connection is reached.
Trying to have 20 players in each room. As soon as player 21st tries to connect, a new instance is created (he would then be alone in this new instance)
Any tips would be much appreciated!
Hello! As of March 2022, is the max number of connections still 100? I know the default value is that but if I set it higher and more players connect, is there going to be a very noticeable difference in the performance?
The more players, the slower your server becomes.
It depends on your game, i.e. simple 2D click & move game can handle way more than complex 3D physics / character controller game.
I know a developer that published on an up-to-date Mirror version and they said their servers were beginning to crash around 60 CCU. Their game had only a handful of NPCs and 1 object per player. The player object itself is only a few networked scripts and a NetworkTransform.
With this in mind, I’d use caution when increasing your max players count.
This question pops up a lot. A simple answer is “it depends”. A more technical answer is that it depends on a lot of factors. Like vis stated above, it really depends on what your Mirror game is - a shooter game running in Mirror is heavier server-wise than a MMO or a simple networked co-op point and click adventure game.
To get a proper answer on the maximum connections Mirror can handle, you must include factors such as:
How much data each object is synchronizing, is it small amounts or huge chunks?
How often is that data being transmitted, like every frame, every second frame, on a interval, when a value changes, etc?
Are things like voice, video and raw data being transmitted, etc?
Amongst a lot of other questions that go deep into the networking rabbit hole.
Mirror can achieve high player count for sure, as some of the games it powers have shown. It’s just a very careful balancing act.
The best advice I can say is forget about what number the “maximum connections” is in Mirror and aim to achieve your desired target - be it 200 players or more. See how the network stack performs. If Mirror royally craps the bed, then okay, that’s a concern. Although with that said, you may surprise yourself.
Keep in mind if it does crap itself at X player count, there is always room for optimization - you just need to get a rough working version of your networked game running, before you optimize.
If you have advanced programming knowledge, you could even replace chunks of Mirror with your own code to make it better and reach higher player counts. This is what some released games have done, basically using their own in-house patched Mirror version.
Coburn, developer of Mirror, I agree users code can affect CCU but I don’t agree that the user should have to modify Mirror core to improve CCU; that statement contradicts the question.
My comment about Mirror servers crashing at 60 CCU were for a very casual, very lightweight game. In my expert and honest opinion, out of the box Mirror should be targeting smaller games. Mirror simply is not optimized for more CCU and/or network activity.
Who are these Mirror users that have problems like crashes but then dont ask for help from Mirror developers about those crash? Sounds like you are making it up to start more drama.
Mirror does have limits, But using the Unity profiler it can be easy to see where the problem is, and if it is with user’s code or mirror code.
I have run a Mirror server in production with 200 CCU with some minor optimizations (like Improved NetworkTransform)
Hello James, another Mirror developer.
I’m speaking of someone which recently left Mirror because their Mirror servers were regularly crashing around 40 CCU. I previously said 60 but after reading back through the conversation it was actually 40. The developer switched to my networking solution without any modifications and had since increased their CCU limit to 500, and they have not reported any problems yet. This would very much suggest it’s a Mirror problem and what I’ve said about Mirror not scaling is reasonably true.
I don’t make up information. I’ll be showcasing the mentioned developer’s game soon enough.
Also, it’s my understanding they did ask for help but did not receive any (not my words).
Let’s try to stay civilized. I’m not attacking anyone, only helping others know what to expect.
This is a thread talking about Mirror why does it matter who is a mirror developer or not? Also I dont work on mirror any more, and you know this, you are just trying to mislead people.
You are here to say “Mirror BAD”, and then advertise your solution.
You have lied about so much stuff in the past, I would be really happy to see proof this time
Hi!
I used Mirror in my game and despite the sheer amount of issues caused by my own code, Mirror easily handled 60 CCU (that’s the maximum amount I tested). Although I don’t like Mirror (or your fork of it for that matter), “crashes at 40 CCU” is a complete nonsense claim with no actual facts behind it. I have also seen and played Mirror games with 100s of CCU.
I’m also not buying the “asking for help and not receiving it” part, you see, I’m constantly on Mirror’s Discord server and so far I have not seen a more helpful community, not just about questions related to Mirror or Unity, but in general. There is even some madman named “MrGadget” who spent 12 hours a day in #help channel answering same questions for years.
Despite your claims to be “superior to Mirror”, you fail to showcase a single game made using your library. You also keep posting benchmark results but present no actual benchmarks or cases.
Mirror on the other hand, despite being bad for many reasons, is used by hundreds of games. Some of them have thousands of CCU (CCU in this sentence means users connected to the game, not a particular server instance).
Now, I’m not a developer of Mirror, I’m just someone who likes hanging around in its Discord server. I’m not saying Mirror is perfect or is what it claims to be. All I’m saying is, you seem to have a ton of baseless claims with absolutely no supporting evidence and you shamelessly keep advertising your heavily modified version of Mirror whenever someone mentions Mirror. This is not something “civilized”, it is the same thing as some kid making a game engine and advertising it in every single Unity support thread.