From 4ff0c391530ad8ce937d281f4ac6492c760080db Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 3 Nov 2008 21:09:30 +0000 Subject: * Expose a client_throttle_multiplier setting in OpenSim.ini. This multiplier is applied to all the client throttle settings received by the client * This should probably be 1, but currently by default it is 8, to reflect what was being eon3 in OpenSim before this revision. So if the client requested a maximum throttle of 1500 kilobits per second, we would actually send out 1500 kilobytes per second * Adjusting this multiplier down towards 1 may improve your OpenSim experience, though in other situations it may degrade (e.g. if you're using a standalone over high bandwidth links) * This is currently a user setting because adjusting it down may currently reveal other OpenSim bugs. --- .../Region/ClientStack/ClientStackUserSettings.cs | 2 +- .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 16 +++++----- .../ClientStack/LindenUDP/LLPacketThrottle.cs | 36 ++++++++++++++++------ .../Region/ClientStack/LindenUDP/LLUDPServer.cs | 2 +- 4 files changed, 36 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/ClientStackUserSettings.cs b/OpenSim/Region/ClientStack/ClientStackUserSettings.cs index 55ccdca..31293d3 100644 --- a/OpenSim/Region/ClientStack/ClientStackUserSettings.cs +++ b/OpenSim/Region/ClientStack/ClientStackUserSettings.cs @@ -44,6 +44,6 @@ namespace OpenSim.Region.ClientStack /// A multiplier applied to all client throttle settings. This is hopefully a temporary setting to iron out /// bugs that appear if the existing incorrect * 8 throttle (bytes instead of bits) is corrected. /// - public int ClientThrottleMultipler; + public float ClientThrottleMultipler; } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 9abde5d..317d852 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -110,13 +110,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP AssetOutgoingPacketQueue = new Queue(); // Set up the throttle classes (min, max, current) in bits per second - ResendThrottle = new LLPacketThrottle(5000, 100000, 16000); - LandThrottle = new LLPacketThrottle(1000, 100000, 2000); - WindThrottle = new LLPacketThrottle(0, 100000, 0); - CloudThrottle = new LLPacketThrottle(0, 100000, 0); - TaskThrottle = new LLPacketThrottle(1000, 800000, 3000); - AssetThrottle = new LLPacketThrottle(1000, 800000, 1000); - TextureThrottle = new LLPacketThrottle(1000, 800000, 4000); + ResendThrottle = new LLPacketThrottle(5000, 100000, 16000, userSettings.ClientThrottleMultipler); + LandThrottle = new LLPacketThrottle(1000, 100000, 2000, userSettings.ClientThrottleMultipler); + WindThrottle = new LLPacketThrottle(0, 100000, 0, userSettings.ClientThrottleMultipler); + CloudThrottle = new LLPacketThrottle(0, 100000, 0, userSettings.ClientThrottleMultipler); + TaskThrottle = new LLPacketThrottle(1000, 800000, 3000, userSettings.ClientThrottleMultipler); + AssetThrottle = new LLPacketThrottle(1000, 800000, 1000, userSettings.ClientThrottleMultipler); + TextureThrottle = new LLPacketThrottle(1000, 800000, 4000, userSettings.ClientThrottleMultipler); // Total Throttle trumps all - it is the number of bits in total that are allowed to go out per second. ThrottleSettings totalThrottleSettings = userSettings.TotalThrottleSettings; @@ -127,7 +127,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TotalThrottle = new LLPacketThrottle( - totalThrottleSettings.Min, totalThrottleSettings.Max, totalThrottleSettings.Current); + totalThrottleSettings.Min, totalThrottleSettings.Max, totalThrottleSettings.Current, userSettings.ClientThrottleMultipler); throttleTimer = new Timer((int) (throttletimems/throttleTimeDivisor)); throttleTimer.Elapsed += new ElapsedEventHandler(ThrottleTimerElapsed); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs index 98b613e..2c67d63 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs @@ -34,12 +34,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP private int m_currentThrottle; private const int m_throttleTimeDivisor = 7; private int m_currentBitsSent; + + /// + /// Temporary field + /// + private float m_throttleMultiplier; - public LLPacketThrottle(int Min, int Max, int Throttle) + /// + /// Constructor. + /// + /// + /// + /// + /// + /// A temporary parameter that's ends up multiplying all throttle settings. This only exists as a path to + /// using real throttle values instead of the *8 multipler that we had been using (bytes instead of btis) + /// + public LLPacketThrottle(int min, int max, int throttle, float throttleMultiplier) { - m_maxAllowableThrottle = Max; - m_minAllowableThrottle = Min; - m_currentThrottle = Throttle; + m_throttleMultiplier = throttleMultiplier; + m_maxAllowableThrottle = (int)(max * throttleMultiplier); + m_minAllowableThrottle = (int)(Min * throttleMultiplier); + m_currentThrottle = (int)(Throttle * throttleMultiplier); m_currentBitsSent = 0; } @@ -61,9 +77,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public int AddBytes(int bytes) { - // XXX: Temporarily treat bytes as bits. This is a temporary revert of r6714 until other underlying issues - // are addressed. - m_currentBitsSent += bytes; + m_currentBitsSent += bytes * 8; return m_currentBitsSent; } @@ -83,17 +97,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP get { return m_currentThrottle; } set { - if (value > m_maxAllowableThrottle) + int multipliedValue = (int)(value * m_throttleMultiplier); + + if (multipliedValue > m_maxAllowableThrottle) { m_currentThrottle = m_maxAllowableThrottle; } - else if (value < m_minAllowableThrottle) + else if (multipliedValue < m_minAllowableThrottle) { m_currentThrottle = m_minAllowableThrottle; } else { - m_currentThrottle = value; + m_currentThrottle = multipliedValue; } } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 72072c2..1779d54 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -155,7 +155,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (config != null) { - userSettings.ClientThrottleMultipler = config.GetInt("client_throttle_multiplier"); + userSettings.ClientThrottleMultipler = config.GetFloat("client_throttle_multiplier"); } //m_log.DebugFormat("[CLIENT]: client_throttle_multiplier = {0}", userSettings.ClientThrottleMultipler); -- cgit v1.1