Cleaned up various configuration options. Removed the category throttle
limits because the only ones used now are the defaults (which are overwritten by the client throttles anyway). Updated the default rates to correspond to about 350kbps. Also added a configuration to disable adaptive throttle. The default is the previous behavior (no adaptation).bulletsim
parent
1d7c83c39f
commit
024c12abc3
|
@ -181,9 +181,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
m_maxRTO = maxRTO;
|
||||
|
||||
// Create a token bucket throttle for this client that has the scene token bucket as a parent
|
||||
m_throttleClient = new AdaptiveTokenBucket(parentThrottle, rates.TotalLimit);
|
||||
m_throttleClient = new AdaptiveTokenBucket(parentThrottle, rates.Total, rates.AdaptiveThrottlesEnabled);
|
||||
// Create a token bucket throttle for the total categary with the client bucket as a throttle
|
||||
m_throttleCategory = new TokenBucket(m_throttleClient, rates.TotalLimit);
|
||||
m_throttleCategory = new TokenBucket(m_throttleClient, rates.Total);
|
||||
// Create an array of token buckets for this clients different throttle categories
|
||||
m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT];
|
||||
|
||||
|
@ -194,7 +194,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
// Initialize the packet outboxes, where packets sit while they are waiting for tokens
|
||||
m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>();
|
||||
// Initialize the token buckets that control the throttling for each category
|
||||
m_throttleCategories[i] = new TokenBucket(m_throttleCategory, rates.GetLimit(type));
|
||||
m_throttleCategories[i] = new TokenBucket(m_throttleCategory, rates.GetRate(type));
|
||||
}
|
||||
|
||||
// Default the retransmission timeout to three seconds
|
||||
|
@ -341,12 +341,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
task = Math.Max(task, LLUDPServer.MTU);
|
||||
texture = Math.Max(texture, LLUDPServer.MTU);
|
||||
asset = Math.Max(asset, LLUDPServer.MTU);
|
||||
state = Math.Max(state, LLUDPServer.MTU);
|
||||
|
||||
int total = resend + land + wind + cloud + task + texture + asset + state;
|
||||
int total = resend + land + wind + cloud + task + texture + asset;
|
||||
|
||||
//m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, State={8}, Total={9}",
|
||||
// AgentID, resend, land, wind, cloud, task, texture, asset, state, total);
|
||||
//m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, Total={8}",
|
||||
// AgentID, resend, land, wind, cloud, task, texture, asset, total);
|
||||
|
||||
// Update the token buckets with new throttle values
|
||||
TokenBucket bucket;
|
||||
|
|
|
@ -52,29 +52,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
public int Texture;
|
||||
/// <summary>Drip rate for asset packets</summary>
|
||||
public int Asset;
|
||||
/// <summary>Drip rate for state packets</summary>
|
||||
public int State;
|
||||
|
||||
/// <summary>Drip rate for the parent token bucket</summary>
|
||||
public int Total;
|
||||
|
||||
/// <summary>Maximum burst rate for resent packets</summary>
|
||||
public int ResendLimit;
|
||||
/// <summary>Maximum burst rate for land packets</summary>
|
||||
public int LandLimit;
|
||||
/// <summary>Maximum burst rate for wind packets</summary>
|
||||
public int WindLimit;
|
||||
/// <summary>Maximum burst rate for cloud packets</summary>
|
||||
public int CloudLimit;
|
||||
/// <summary>Maximum burst rate for task (state and transaction) packets</summary>
|
||||
public int TaskLimit;
|
||||
/// <summary>Maximum burst rate for texture packets</summary>
|
||||
public int TextureLimit;
|
||||
/// <summary>Maximum burst rate for asset packets</summary>
|
||||
public int AssetLimit;
|
||||
/// <summary>Maximum burst rate for state packets</summary>
|
||||
public int StateLimit;
|
||||
/// <summary>Burst rate for the parent token bucket</summary>
|
||||
public int TotalLimit;
|
||||
/// <summary>Flag used to enable adaptive throttles</summary>
|
||||
public bool AdaptiveThrottlesEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
|
@ -86,26 +69,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
{
|
||||
IConfig throttleConfig = config.Configs["ClientStack.LindenUDP"];
|
||||
|
||||
Resend = throttleConfig.GetInt("resend_default", 12500);
|
||||
Land = throttleConfig.GetInt("land_default", 1000);
|
||||
Wind = throttleConfig.GetInt("wind_default", 1000);
|
||||
Cloud = throttleConfig.GetInt("cloud_default", 1000);
|
||||
Task = throttleConfig.GetInt("task_default", 1000);
|
||||
Texture = throttleConfig.GetInt("texture_default", 1000);
|
||||
Asset = throttleConfig.GetInt("asset_default", 1000);
|
||||
State = throttleConfig.GetInt("state_default", 1000);
|
||||
|
||||
ResendLimit = throttleConfig.GetInt("resend_limit", 18750);
|
||||
LandLimit = throttleConfig.GetInt("land_limit", 29750);
|
||||
WindLimit = throttleConfig.GetInt("wind_limit", 18750);
|
||||
CloudLimit = throttleConfig.GetInt("cloud_limit", 18750);
|
||||
TaskLimit = throttleConfig.GetInt("task_limit", 18750);
|
||||
TextureLimit = throttleConfig.GetInt("texture_limit", 55750);
|
||||
AssetLimit = throttleConfig.GetInt("asset_limit", 27500);
|
||||
StateLimit = throttleConfig.GetInt("state_limit", 37000);
|
||||
Resend = throttleConfig.GetInt("resend_default", 6625);
|
||||
Land = throttleConfig.GetInt("land_default", 9125);
|
||||
Wind = throttleConfig.GetInt("wind_default", 1750);
|
||||
Cloud = throttleConfig.GetInt("cloud_default", 1750);
|
||||
Task = throttleConfig.GetInt("task_default", 18500);
|
||||
Texture = throttleConfig.GetInt("texture_default", 18500);
|
||||
Asset = throttleConfig.GetInt("asset_default", 10500);
|
||||
|
||||
Total = throttleConfig.GetInt("client_throttle_max_bps", 0);
|
||||
TotalLimit = Total;
|
||||
|
||||
AdaptiveThrottlesEnabled = throttleConfig.GetBoolean("enable_adaptive_throttles", false);
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
@ -128,34 +102,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
return Texture;
|
||||
case ThrottleOutPacketType.Asset:
|
||||
return Asset;
|
||||
case ThrottleOutPacketType.State:
|
||||
return State;
|
||||
case ThrottleOutPacketType.Unknown:
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public int GetLimit(ThrottleOutPacketType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ThrottleOutPacketType.Resend:
|
||||
return ResendLimit;
|
||||
case ThrottleOutPacketType.Land:
|
||||
return LandLimit;
|
||||
case ThrottleOutPacketType.Wind:
|
||||
return WindLimit;
|
||||
case ThrottleOutPacketType.Cloud:
|
||||
return CloudLimit;
|
||||
case ThrottleOutPacketType.Task:
|
||||
return TaskLimit;
|
||||
case ThrottleOutPacketType.Texture:
|
||||
return TextureLimit;
|
||||
case ThrottleOutPacketType.Asset:
|
||||
return AssetLimit;
|
||||
case ThrottleOutPacketType.State:
|
||||
return StateLimit;
|
||||
case ThrottleOutPacketType.Unknown:
|
||||
default:
|
||||
return 0;
|
||||
|
|
|
@ -340,6 +340,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
set { m_maxDripRate = (value == 0 ? 0 : Math.Max(value,m_minimumFlow)); }
|
||||
}
|
||||
|
||||
private bool m_enabled = false;
|
||||
|
||||
// <summary>
|
||||
//
|
||||
// </summary>
|
||||
|
@ -357,9 +359,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
// <summary>
|
||||
//
|
||||
// </summary>
|
||||
public AdaptiveTokenBucket(TokenBucket parent, Int64 maxDripRate) : base(parent,m_minimumFlow)
|
||||
public AdaptiveTokenBucket(TokenBucket parent, Int64 maxDripRate, bool enabled) : base(parent,maxDripRate)
|
||||
{
|
||||
MaxDripRate = maxDripRate;
|
||||
m_enabled = enabled;
|
||||
|
||||
if (m_enabled)
|
||||
{
|
||||
m_log.WarnFormat("[TOKENBUCKET] Adaptive throttle enabled");
|
||||
MaxDripRate = maxDripRate;
|
||||
AdjustedDripRate = m_minimumFlow;
|
||||
}
|
||||
}
|
||||
|
||||
// <summary>
|
||||
|
@ -368,7 +377,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
public void ExpirePackets(Int32 count)
|
||||
{
|
||||
// m_log.WarnFormat("[ADAPTIVEBUCKET] drop {0} by {1} expired packets",AdjustedDripRate,count);
|
||||
AdjustedDripRate = (Int64) (AdjustedDripRate / Math.Pow(2,count));
|
||||
if (m_enabled)
|
||||
AdjustedDripRate = (Int64) (AdjustedDripRate / Math.Pow(2,count));
|
||||
}
|
||||
|
||||
// <summary>
|
||||
|
@ -376,7 +386,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
// </summary>
|
||||
public void AcknowledgePackets(Int32 count)
|
||||
{
|
||||
AdjustedDripRate = AdjustedDripRate + count;
|
||||
if (m_enabled)
|
||||
AdjustedDripRate = AdjustedDripRate + count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -451,7 +451,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
|
|||
int maxRegionNameLength = 14;
|
||||
int maxTypeLength = 4;
|
||||
|
||||
string name = "SERVER AGENT LIMITS";
|
||||
string name = "SERVER AGENT RATES";
|
||||
|
||||
report.Append(GetColumnEntry(name, maxNameLength, columnPadding));
|
||||
report.Append(GetColumnEntry("-", maxRegionNameLength, columnPadding));
|
||||
|
@ -461,13 +461,13 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
|
|||
report.AppendFormat(
|
||||
"{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}",
|
||||
(throttleRates.Total * 8) / 1000,
|
||||
(throttleRates.ResendLimit * 8) / 1000,
|
||||
(throttleRates.LandLimit * 8) / 1000,
|
||||
(throttleRates.WindLimit * 8) / 1000,
|
||||
(throttleRates.CloudLimit * 8) / 1000,
|
||||
(throttleRates.TaskLimit * 8) / 1000,
|
||||
(throttleRates.TextureLimit * 8) / 1000,
|
||||
(throttleRates.AssetLimit * 8) / 1000);
|
||||
(throttleRates.Resend * 8) / 1000,
|
||||
(throttleRates.Land * 8) / 1000,
|
||||
(throttleRates.Wind * 8) / 1000,
|
||||
(throttleRates.Cloud * 8) / 1000,
|
||||
(throttleRates.Task * 8) / 1000,
|
||||
(throttleRates.Texture * 8) / 1000,
|
||||
(throttleRates.Asset * 8) / 1000);
|
||||
|
||||
return report.ToString();
|
||||
}
|
||||
|
|
|
@ -362,30 +362,24 @@
|
|||
;
|
||||
;client_throttle_max_bps = 196608
|
||||
|
||||
; Per-client bytes per second rates for the various throttle categories.
|
||||
; These are default values that will be overriden by clients
|
||||
; Adaptive throttling attempts to limit network overload when multiple
|
||||
; clients login by starting each connection more slowly. Disabled by
|
||||
; default
|
||||
;
|
||||
;resend_default = 12500
|
||||
;land_default = 1000
|
||||
;wind_default = 1000
|
||||
;cloud_default = 1000
|
||||
;task_default = 1000
|
||||
;texture_default = 1000
|
||||
;asset_default = 1000
|
||||
;state_default = 1000
|
||||
;enable_adaptive_throttles = true
|
||||
|
||||
; Per-client maximum burst rates in bytes per second for the various
|
||||
; throttle categories. These are default values that will be overriden by
|
||||
; clients
|
||||
;
|
||||
;resend_limit = 18750
|
||||
;land_limit = 29750
|
||||
;wind_limit = 18750
|
||||
;cloud_limit = 18750
|
||||
;task_limit = 18750
|
||||
;texture_limit = 55750
|
||||
;asset_limit = 27500
|
||||
;state_limit = 37000
|
||||
; Per-client bytes per second rates for the various throttle categories.
|
||||
; These are default values that will be overriden by clients. These
|
||||
; defaults are approximately equivalent to the throttles set by the Imprudence
|
||||
; viewer when maximum bandwidth is set to 350kbps
|
||||
|
||||
;resend_default = 6625
|
||||
;land_default = 9125
|
||||
;wind_default = 1750
|
||||
;cloud_default = 1750
|
||||
;task_default = 18500
|
||||
;texture_default = 18500
|
||||
;asset_default = 10500
|
||||
|
||||
; Configures how ObjectUpdates are aggregated. These numbers
|
||||
; do not literally mean how many updates will be put in each
|
||||
|
|
Loading…
Reference in New Issue