com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

Some metrics went over the configured limits

Open daalen opened this issue 3 years ago • 5 comments

Whenever a client connects to my server I get spawned with dozens of identical warnings about some metrics – but I have no idea what these metrics are or how to configure them. The full error is:

Some metrics in the collection went over the configured values limit. Some values were ignored. UnityEngine.Debug:LogWarning (object) Unity.Multiplayer.Tools.NetStats.MetricDispatcher:Dispatch () (at Library/PackageCache/[email protected]/NetStats/Runtime/Dispatch/MetricDispatcher.cs:50) Unity.Netcode.NetworkMetrics:DispatchFrame () (at Library/PackageCache/[email protected]/Runtime/Metrics/NetworkMetrics.cs:518) Unity.Netcode.NetworkManager:OnNetworkPostLateUpdate () (at Library/PackageCache/[email protected]/Runtime/Core/NetworkManager.cs:1525) Unity.Netcode.NetworkManager:NetworkUpdate (Unity.Netcode.NetworkUpdateStage) (at Library/PackageCache/[email protected]/Runtime/Core/NetworkManager.cs:1420) Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage) (at Library/PackageCache/[email protected]/Runtime/Core/NetworkUpdateLoop.cs:149) Unity.Netcode.NetworkUpdateLoop/NetworkPostLateUpdate/<>c:<CreateLoopSystem>b__0_0 () (at Library/PackageCache/[email protected]/Runtime/Core/NetworkUpdateLoop.cs:232)

What can I do to prevent this?

daalen avatar Jul 09 '22 08:07 daalen

Setting the max payload size ridiculously high helps, but then I get these warnings instead:

A lot of pipeline updates have been queued, possibly too many being scheduled in pipeline logic, queue count: 68

These warnings are really not informative, what is going on?

daalen avatar Jul 13 '22 17:07 daalen

Hi @daalen, Thank you for reporting! We are aware of this issue and is being tracked in our backlog. I will post here when we have an update.

ashwinimurt avatar Jul 20 '22 21:07 ashwinimurt

Backlog: MTT-3388

ashwinimurt avatar Jul 20 '22 21:07 ashwinimurt

Note - there's two different warnings reported in this issue and while both are probably caused by a high volume of network traffic being transmitted, they're coming from different places and may need different solutions.

Some metrics in the collection went over the configured values limit. Some values were ignored.

This is coming from too many network events happening in a short window of time, and is coming from the com.unity.multiplayer.tools package. There should be no practical effect here other than missing data in the profiler. It's on our backlog to address this, especially because the warning itself can cause performance issues.

A lot of pipeline updates have been queued, possibly too many being scheduled in pipeline logic, queue count: 68

This is caused by too much data being sent to the transport. I'm not sure myself the best way to address this, I think you're on the right track for increasing the max payload size. Someone from the SDK or Transport teams may be able to give better help.

becksebenius-unity avatar Jul 20 '22 22:07 becksebenius-unity

Good to know, thanks!

daalen avatar Jul 21 '22 09:07 daalen

The default Max Payload Size is 6144. I'm getting "Couldn't add payload of size 17135 to reliable send queue. Closing connection 1 as reliability guarantees can't be maintained" for one of my scenes, but I haven't been encountering this in general. Max Payload Size isn't well documented, and I don't see a large volume of RPCs, so I'm not sure what's causing this scene to have a much larger payload.

The profiler says the Load (my scene) -- Scene Event -- is 17 kb ... do I just have more NetworkObjects living in this scene, is it that simple?

Related: https://github.com/Unity-Technologies/com.unity.multiplayer.docs/issues/1111

zachstronaut avatar Sep 13 '23 21:09 zachstronaut

The profiler says the Load (my scene) -- Scene Event -- is 17 kb ... do I just have more NetworkObjects living in this scene, is it that simple?

Yes, the initial client synchronization message sent after a client connection has been approved is dependent upon the amount of NetworkObjects you could potentially have spawned (everything spawned needs to be synchronized). Depending upon the platform you are targeting depends upon how "granular" you might want to get with this setting... typically just setting MaxPayloadSize between 128KB to 256KB will cover "almost" all scenarios unless you have a custom message, RPC, or really large NetworkVariable/NetworkList that could send a serialized data block that exceeds that size...then you would want to make your MaxPayloadSize be a bit larger than the "largest' block of data you would send.

But I don't think this is related to the metric issue...which I am thinking has been resolved in one of the more recent updates to the multiplayer tools package.

NoelStephensUnity avatar Oct 03 '23 18:10 NoelStephensUnity

In our pursuit of ensuring the best possible experience for you, we have released recent Multiplayer Tools ([email protected]) which should have enhancements that solves this issue.

If you are still encountering this issue, please open a new bug through GitHub or Unity Bug Reporting page and our team will gladly look at it again.

fluong6 avatar Oct 04 '23 17:10 fluong6