MirrorNetworking / MirrorNetworking/Mirror
Bandwidth Abuse
Open
@miwarnec is already working on this.
Since May 20, 2024.
bug
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 870
- PR merge metrics
- No merged PRs in 30d
Description
Too much bandwidth overhead
- We're sending Ping/Pong bidirectionally at 10Hz
- Hard-coded DefaultPingInterval set to 0.1f
- We're also sending TimeSnapshot bidirectionally at 60Hz
- Governed by Network Manager Send Rate
Pull the TestPingPong branch
- This branch has additional logging added to:
NetworkManagerNetworkTimeNetworkConnectionToClientNetworkClientNetworkServer
- This branch also has Mirage Profiler added to package manifest.
Setting Up
- In the Mirror/Tests folder, find TestPingPong folder
- Open the scene and add to build settings
- Switch to Dedicated Server platform, Build and Run (IL2CPP)
- Switch to Desktop platform
- Open Profiler window and enable Deep Profiling
- Also add Mirror Received and Mirror Sent modules to profiler
- Editor Console: enable Collapse
- Play in editor and connect the client (there is intentionally no Player object)
- Observe the timestamped log flood in editor and server consoles
- Observe the bandwidth used in the profiler (400B/s in, 500B/s out)
Remedies
- Only NT / Prediction needs Snapshot messages, so only enable when they're activated at runtime
- Does this really need to be 60Hz? Couldn't this be capped at something sufficient, like 30Hz or less?
- Nothing needs Ping/Pong at 10Hz - Default should be reset back to 0.5Hz or lower as a base keep-alive.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.