diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-03-13 23:55:38 +0200 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-03-18 21:25:09 +0200 |
commit | c99e3167ed8549bc13d7df03b1e12dc15b0a080f (patch) | |
tree | 898e1979506ef7e82d7489e0e328143629a6face /indra/newview/llviewerthrottle.cpp | |
parent | d3d0728bac31099785fea1bf87f11b7c29d2425d (diff) |
#3644 Adjust throttle based of how busy buffer is
Diffstat (limited to 'indra/newview/llviewerthrottle.cpp')
-rw-r--r-- | indra/newview/llviewerthrottle.cpp | 14 |
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; } |