In this lesson, you will learn how to use built-in console commands to identify and diagnose network replication bottlenecks in real-time.
When your multiplayer game experiences "hitchy" movement or delayed state updates, it is often due to saturation of the network channel or an overloaded NetDriver. Before jumping into complex profilers, you should start with the stat net command.
Monitoring with stat net
Entering stat net in the console overlays vital information on your viewport. The most critical metrics to watch are:
- Pkt Loss %: Indicates if packets are being dropped, which causes jitter and state misprediction.
- Pkt Size (Avg): Shows the average bytes per packet. If this consistently hits your
MaxPacketSize, you are likely fragmenting data or causing congestion. - In/Out Rate: Represents your bandwidth consumption. If your
Out Rateexceeds theMaxClientRatedefined in your project settings, the server will throttle your updates, leading to noticeable replication lag.
Diagnosing Object Saturation with stat netservers
If your bandwidth looks fine but you are still experiencing latency, the culprit might be an excessive number of objects attempting to replicate simultaneously. Use stat netservers to track how many actors are currently being updated by the server.
If you see the ActorCount or NetObjects climbing rapidly, your NetUpdateFrequency settings may be too aggressive for the current player count. You can test this by temporarily capping the update rate via the console:
p.NetMaxUpdateRate 30
Visualizing Bottlenecks
For a more granular view of what is consuming your bandwidth, use net PROFILE. This command generates a summary of which actors are sending the most data. By identifying the "heaviest" actors, you can decide which ones need to be moved to NetUpdateFrequency optimizations or which properties should be moved to specialized Fast TArray or delta-compressed replication paths.
When you observe high Out Rate combined with high ActorCount, you have successfully identified a throughput bottleneck that requires re-evaluating your actor relevance or update frequency logic.
Key Takeaway: Use stat net and stat netservers as your primary triage tools to determine if your performance issues stem from raw bandwidth saturation or an excessive volume of replicating actors.