summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerthrottle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerthrottle.cpp')
-rw-r--r--indra/newview/llviewerthrottle.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/indra/newview/llviewerthrottle.cpp b/indra/newview/llviewerthrottle.cpp
index b0a00c29a4..8d935e4243 100644
--- a/indra/newview/llviewerthrottle.cpp
+++ b/indra/newview/llviewerthrottle.cpp
@@ -48,6 +48,8 @@ const F32 MIN_FRACTIONAL = 0.2f;
const F32 MIN_BANDWIDTH = 50.f;
const F32 MAX_BANDWIDTH = 6000.f;
const F32 STEP_FRACTIONAL = 0.1f;
+const F32 HIGH_BUFFER_LOAD_TRESHOLD = 1.f;
+const F32 LOW_BUFFER_LOAD_TRESHOLD = 0.8f;
const LLUnit<F32, LLUnits::Percent> TIGHTEN_THROTTLE_THRESHOLD(3.0f); // packet loss % per s
const LLUnit<F32, LLUnits::Percent> EASE_THROTTLE_THRESHOLD(0.5f); // packet loss % per s
const F32 DYNAMIC_UPDATE_DURATION = 5.0f; // seconds
@@ -146,7 +148,7 @@ LLViewerThrottleGroup LLViewerThrottleGroup::operator-(const LLViewerThrottleGro
void LLViewerThrottleGroup::sendToSim() const
{
- LL_INFOS() << "Sending throttle settings, total BW " << mThrottleTotal << LL_ENDL;
+ LL_DEBUGS("Throttle") << "Sending throttle settings, total BW " << mThrottleTotal << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_AgentThrottle);
@@ -305,7 +307,10 @@ void LLViewerThrottle::updateDynamicThrottle()
mUpdateTimer.reset();
LLUnit<F32, LLUnits::Percent> mean_packets_lost = LLViewerStats::instance().getRecording().getMean(LLStatViewer::PACKETS_LOST_PERCENT);
- if (mean_packets_lost > TIGHTEN_THROTTLE_THRESHOLD)
+ if (
+ mean_packets_lost > TIGHTEN_THROTTLE_THRESHOLD // already losing packets
+ || mBufferLoadRate >= HIGH_BUFFER_LOAD_TRESHOLD // let viewer sort through the backlog before it starts dropping packets
+ )
{
if (mThrottleFrac <= MIN_FRACTIONAL || mCurrentBandwidth / 1024.0f <= MIN_BANDWIDTH)
{
@@ -318,7 +323,8 @@ void LLViewerThrottle::updateDynamicThrottle()
mCurrent.sendToSim();
LL_INFOS() << "Tightening network throttle to " << mCurrentBandwidth << LL_ENDL;
}
- else if (mean_packets_lost <= EASE_THROTTLE_THRESHOLD)
+ else if (mean_packets_lost <= EASE_THROTTLE_THRESHOLD
+ && mBufferLoadRate < LOW_BUFFER_LOAD_TRESHOLD)
{
if (mThrottleFrac >= MAX_FRACTIONAL || mCurrentBandwidth / 1024.0f >= MAX_BANDWIDTH)
{
@@ -331,4 +337,6 @@ void LLViewerThrottle::updateDynamicThrottle()
mCurrent.sendToSim();
LL_INFOS() << "Easing network throttle to " << mCurrentBandwidth << LL_ENDL;
}
+
+ mBufferLoadRate = 0;
}