MirrorNetworking / MirrorNetworking/Mirror

Bandwidth Abuse

Open
#3,828 2 comments 0 reactions 1 assignee View on GitHub

@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:
    • NetworkManager
    • NetworkTime
    • NetworkConnectionToClient
    • NetworkClient
    • NetworkServer
  • 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.

image

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.