net.QueuedBunchTimeFailsafeSeconds
net.QueuedBunchTimeFailsafeSeconds
#Overview
name: net.QueuedBunchTimeFailsafeSeconds
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Amount of time in seconds to wait with queued bunches before forcibly processing them all, ignoring the NetDriver\'s HasExceededIncomingBunchFrameProcessingTime.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of net.QueuedBunchTimeFailsafeSeconds is to set a time limit for processing queued network bunches in Unreal Engine’s networking system. It acts as a failsafe mechanism to prevent network data from being stuck in the queue for too long.
This setting variable is primarily used by Unreal Engine’s networking subsystem, specifically within the NetDriver module. It’s an integral part of the engine’s network data processing and management system.
The value of this variable is set using an FAutoConsoleVariableRef in the DataChannel.cpp file. It’s initialized with a default value of 2.0 seconds but can be modified at runtime through the console or configuration files.
This variable interacts with other networking-related variables and functions, particularly those dealing with bunch processing and channel management. It’s closely related to the QueuedBunchFailsafeNumChannels counter in the NetDriver class.
Developers must be aware that this variable affects the behavior of network data processing. If set too low, it might cause premature processing of bunches, potentially leading to increased network traffic. If set too high, it could result in delayed processing of important network data.
Best practices when using this variable include:
- Carefully consider the implications of modifying its value, as it can affect network performance and game responsiveness.
- Monitor the QueuedBunchFailsafeNumChannels counter to understand how often the failsafe is being triggered.
- Use in conjunction with other network optimization techniques and settings for best results.
- Test thoroughly with various network conditions to ensure optimal performance across different scenarios.
- Consider logging or profiling when adjusting this value to measure its impact on network performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DataChannel.cpp:172
Scope (from outer to inner):
file
namespace UE::Net
Source code excerpt:
static float QueuedBunchTimeFailsafeSeconds = 2.0f;
static FAutoConsoleVariableRef CVarNetQueuedBunchTimeFailsafeSeconds(
TEXT("net.QueuedBunchTimeFailsafeSeconds"),
QueuedBunchTimeFailsafeSeconds,
TEXT("Amount of time in seconds to wait with queued bunches before forcibly processing them all, ignoring the NetDriver's HasExceededIncomingBunchFrameProcessingTime."));
// bTearOff is private but we still might need to adjust the flag on clients based on the channel close reason
class FTearOffSetter final
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/NetDriver.h:2185
Scope: file
Source code excerpt:
void AddBunchProcessingFrameTimeMS(float Milliseconds) { IncomingBunchProcessingElapsedFrameTimeMS += Milliseconds; }
/** Called internally by channels to track how many hit net.QueuedBunchTimeFailsafeSeconds */
void AddQueuedBunchFailsafeChannel() { ++QueuedBunchFailsafeNumChannels; }
protected:
/** Stream of random numbers to be used by this instance of UNetDriver */
FRandomStream UpdateDelayRandomStream;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/NetDriver.h:2317
Scope: file
Source code excerpt:
uint32 NumFramesOverIncomingBunchTimeLimit = 0;
/** Accumulated number of channels that hit the net.QueuedBunchTimeFailsafeSeconds this frame */
uint32 QueuedBunchFailsafeNumChannels = 0;
};