mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 01:35:46 +08:00
* 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.
This commit is contained in:
@@ -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.
|
||||
/// </summary>
|
||||
public int ClientThrottleMultipler;
|
||||
public float ClientThrottleMultipler;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,13 +110,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
AssetOutgoingPacketQueue = new Queue<LLQueItem>();
|
||||
|
||||
// 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);
|
||||
|
||||
@@ -34,12 +34,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
private int m_currentThrottle;
|
||||
private const int m_throttleTimeDivisor = 7;
|
||||
private int m_currentBitsSent;
|
||||
|
||||
/// <value>
|
||||
/// Temporary field
|
||||
/// </value>
|
||||
private float m_throttleMultiplier;
|
||||
|
||||
public LLPacketThrottle(int Min, int Max, int Throttle)
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="min"></param>
|
||||
/// <param name="max"></param>
|
||||
/// <param name="throttle"></param>
|
||||
/// <param name="throttleMultiplier">
|
||||
/// 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)
|
||||
/// </param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user