From 0d2e6463d714bce8a6a628bd647c625feeeae8f6 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 14 Oct 2009 11:43:31 -0700 Subject: * Minimized the number of times textures are pulled off the priority queue * OnQueueEmpty is still called async, but will not be called for a given category if the previous callback for that category is still running. This is the most balanced behavior I could find, and seems to work well * Added support for the old [ClientStack.LindenUDP] settings (including setting the receive buffer size) and added the new token bucket and global throttle settings * Added the AssetLoaderEnabled config variable to optionally disable loading assets from XML every startup. This gives a dramatic improvement in startup times for those who don't need the functionality every startup --- .../Region/ClientStack/LindenUDP/ThrottleRates.cs | 36 +++++++++++++--------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs b/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs index 858a03c..adad4c3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs @@ -51,6 +51,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP public int Texture; /// Drip rate for asset packets public int Asset; + /// Drip rate for the parent token bucket + public int Total; /// Maximum burst rate for resent packets public int ResendLimit; @@ -66,6 +68,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP public int TextureLimit; /// Maximum burst rate for asset packets public int AssetLimit; + /// Burst rate for the parent token bucket + public int TotalLimit; /// /// Default constructor @@ -77,21 +81,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP { IConfig throttleConfig = config.Configs["ClientStack.LindenUDP"]; - Resend = throttleConfig.GetInt("ResendDefault", 12500); - Land = throttleConfig.GetInt("LandDefault", 500); - Wind = throttleConfig.GetInt("WindDefault", 500); - Cloud = throttleConfig.GetInt("CloudDefault", 500); - Task = throttleConfig.GetInt("TaskDefault", 500); - Texture = throttleConfig.GetInt("TextureDefault", 500); - Asset = throttleConfig.GetInt("AssetDefault", 500); + Resend = throttleConfig.GetInt("resend_default", 12500); + Land = throttleConfig.GetInt("land_default", 500); + Wind = throttleConfig.GetInt("wind_default", 500); + Cloud = throttleConfig.GetInt("cloud_default", 500); + Task = throttleConfig.GetInt("task_default", 500); + Texture = throttleConfig.GetInt("texture_default", 500); + Asset = throttleConfig.GetInt("asset_default", 500); - ResendLimit = throttleConfig.GetInt("ResendLimit", 18750); - LandLimit = throttleConfig.GetInt("LandLimit", 29750); - WindLimit = throttleConfig.GetInt("WindLimit", 18750); - CloudLimit = throttleConfig.GetInt("CloudLimit", 18750); - TaskLimit = throttleConfig.GetInt("TaskLimit", 55750); - TextureLimit = throttleConfig.GetInt("TextureLimit", 55750); - AssetLimit = throttleConfig.GetInt("AssetLimit", 27500); + Total = throttleConfig.GetInt("client_throttle_max_bps", 0); + + 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", 55750); + TextureLimit = throttleConfig.GetInt("texture_limit", 55750); + AssetLimit = throttleConfig.GetInt("asset_limit", 27500); + + TotalLimit = throttleConfig.GetInt("client_throttle_max_bps", 0); } catch (Exception) { } } -- cgit v1.1 From 82012ec4e3c441021795c66112a66e002d459e73 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 14 Oct 2009 16:21:48 -0700 Subject: * Clean up the SetThrottle() code and add a maxBurstRate parameter to allow more tweaking in the future --- .../Region/ClientStack/LindenUDP/ThrottleRates.cs | 63 +++++++++++++++++++++- 1 file changed, 61 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs b/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs index adad4c3..008d827 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs @@ -26,6 +26,7 @@ */ using System; +using OpenSim.Framework; using Nini.Config; namespace OpenSim.Region.ClientStack.LindenUDP @@ -45,12 +46,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP public int Wind; /// Drip rate for cloud packets public int Cloud; - /// Drip rate for task (state and transaction) packets + /// Drip rate for task packets public int Task; /// Drip rate for texture packets public int Texture; /// Drip rate for asset packets public int Asset; + /// Drip rate for state packets + public int State; /// Drip rate for the parent token bucket public int Total; @@ -68,6 +71,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP public int TextureLimit; /// Maximum burst rate for asset packets public int AssetLimit; + /// Maximum burst rate for state packets + public int StateLimit; /// Burst rate for the parent token bucket public int TotalLimit; @@ -88,6 +93,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP Task = throttleConfig.GetInt("task_default", 500); Texture = throttleConfig.GetInt("texture_default", 500); Asset = throttleConfig.GetInt("asset_default", 500); + State = throttleConfig.GetInt("state_default", 500); Total = throttleConfig.GetInt("client_throttle_max_bps", 0); @@ -95,13 +101,66 @@ namespace OpenSim.Region.ClientStack.LindenUDP LandLimit = throttleConfig.GetInt("land_limit", 29750); WindLimit = throttleConfig.GetInt("wind_limit", 18750); CloudLimit = throttleConfig.GetInt("cloud_limit", 18750); - TaskLimit = throttleConfig.GetInt("task_limit", 55750); + TaskLimit = throttleConfig.GetInt("task_limit", 18750); TextureLimit = throttleConfig.GetInt("texture_limit", 55750); AssetLimit = throttleConfig.GetInt("asset_limit", 27500); + State = throttleConfig.GetInt("state_limit", 37000); TotalLimit = throttleConfig.GetInt("client_throttle_max_bps", 0); } catch (Exception) { } } + + public int GetRate(ThrottleOutPacketType type) + { + switch (type) + { + case ThrottleOutPacketType.Resend: + return Resend; + case ThrottleOutPacketType.Land: + return Land; + case ThrottleOutPacketType.Wind: + return Wind; + case ThrottleOutPacketType.Cloud: + return Cloud; + case ThrottleOutPacketType.Task: + return Task; + case ThrottleOutPacketType.Texture: + 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; + } + } } } -- cgit v1.1