aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-14 16:21:48 -0700
committerJohn Hurliman2009-10-14 16:21:48 -0700
commit82012ec4e3c441021795c66112a66e002d459e73 (patch)
treee14187ec631f08cb56e0c5da3a28aa8cb727b378 /OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs
parent* Switched to a plain lock for the ClientManager collections and protected th... (diff)
downloadopensim-SC-82012ec4e3c441021795c66112a66e002d459e73.zip
opensim-SC-82012ec4e3c441021795c66112a66e002d459e73.tar.gz
opensim-SC-82012ec4e3c441021795c66112a66e002d459e73.tar.bz2
opensim-SC-82012ec4e3c441021795c66112a66e002d459e73.tar.xz
* Clean up the SetThrottle() code and add a maxBurstRate parameter to allow more tweaking in the future
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs63
1 files changed, 61 insertions, 2 deletions
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 @@
26 */ 26 */
27 27
28using System; 28using System;
29using OpenSim.Framework;
29using Nini.Config; 30using Nini.Config;
30 31
31namespace OpenSim.Region.ClientStack.LindenUDP 32namespace OpenSim.Region.ClientStack.LindenUDP
@@ -45,12 +46,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
45 public int Wind; 46 public int Wind;
46 /// <summary>Drip rate for cloud packets</summary> 47 /// <summary>Drip rate for cloud packets</summary>
47 public int Cloud; 48 public int Cloud;
48 /// <summary>Drip rate for task (state and transaction) packets</summary> 49 /// <summary>Drip rate for task packets</summary>
49 public int Task; 50 public int Task;
50 /// <summary>Drip rate for texture packets</summary> 51 /// <summary>Drip rate for texture packets</summary>
51 public int Texture; 52 public int Texture;
52 /// <summary>Drip rate for asset packets</summary> 53 /// <summary>Drip rate for asset packets</summary>
53 public int Asset; 54 public int Asset;
55 /// <summary>Drip rate for state packets</summary>
56 public int State;
54 /// <summary>Drip rate for the parent token bucket</summary> 57 /// <summary>Drip rate for the parent token bucket</summary>
55 public int Total; 58 public int Total;
56 59
@@ -68,6 +71,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
68 public int TextureLimit; 71 public int TextureLimit;
69 /// <summary>Maximum burst rate for asset packets</summary> 72 /// <summary>Maximum burst rate for asset packets</summary>
70 public int AssetLimit; 73 public int AssetLimit;
74 /// <summary>Maximum burst rate for state packets</summary>
75 public int StateLimit;
71 /// <summary>Burst rate for the parent token bucket</summary> 76 /// <summary>Burst rate for the parent token bucket</summary>
72 public int TotalLimit; 77 public int TotalLimit;
73 78
@@ -88,6 +93,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
88 Task = throttleConfig.GetInt("task_default", 500); 93 Task = throttleConfig.GetInt("task_default", 500);
89 Texture = throttleConfig.GetInt("texture_default", 500); 94 Texture = throttleConfig.GetInt("texture_default", 500);
90 Asset = throttleConfig.GetInt("asset_default", 500); 95 Asset = throttleConfig.GetInt("asset_default", 500);
96 State = throttleConfig.GetInt("state_default", 500);
91 97
92 Total = throttleConfig.GetInt("client_throttle_max_bps", 0); 98 Total = throttleConfig.GetInt("client_throttle_max_bps", 0);
93 99
@@ -95,13 +101,66 @@ namespace OpenSim.Region.ClientStack.LindenUDP
95 LandLimit = throttleConfig.GetInt("land_limit", 29750); 101 LandLimit = throttleConfig.GetInt("land_limit", 29750);
96 WindLimit = throttleConfig.GetInt("wind_limit", 18750); 102 WindLimit = throttleConfig.GetInt("wind_limit", 18750);
97 CloudLimit = throttleConfig.GetInt("cloud_limit", 18750); 103 CloudLimit = throttleConfig.GetInt("cloud_limit", 18750);
98 TaskLimit = throttleConfig.GetInt("task_limit", 55750); 104 TaskLimit = throttleConfig.GetInt("task_limit", 18750);
99 TextureLimit = throttleConfig.GetInt("texture_limit", 55750); 105 TextureLimit = throttleConfig.GetInt("texture_limit", 55750);
100 AssetLimit = throttleConfig.GetInt("asset_limit", 27500); 106 AssetLimit = throttleConfig.GetInt("asset_limit", 27500);
107 State = throttleConfig.GetInt("state_limit", 37000);
101 108
102 TotalLimit = throttleConfig.GetInt("client_throttle_max_bps", 0); 109 TotalLimit = throttleConfig.GetInt("client_throttle_max_bps", 0);
103 } 110 }
104 catch (Exception) { } 111 catch (Exception) { }
105 } 112 }
113
114 public int GetRate(ThrottleOutPacketType type)
115 {
116 switch (type)
117 {
118 case ThrottleOutPacketType.Resend:
119 return Resend;
120 case ThrottleOutPacketType.Land:
121 return Land;
122 case ThrottleOutPacketType.Wind:
123 return Wind;
124 case ThrottleOutPacketType.Cloud:
125 return Cloud;
126 case ThrottleOutPacketType.Task:
127 return Task;
128 case ThrottleOutPacketType.Texture:
129 return Texture;
130 case ThrottleOutPacketType.Asset:
131 return Asset;
132 case ThrottleOutPacketType.State:
133 return State;
134 case ThrottleOutPacketType.Unknown:
135 default:
136 return 0;
137 }
138 }
139
140 public int GetLimit(ThrottleOutPacketType type)
141 {
142 switch (type)
143 {
144 case ThrottleOutPacketType.Resend:
145 return ResendLimit;
146 case ThrottleOutPacketType.Land:
147 return LandLimit;
148 case ThrottleOutPacketType.Wind:
149 return WindLimit;
150 case ThrottleOutPacketType.Cloud:
151 return CloudLimit;
152 case ThrottleOutPacketType.Task:
153 return TaskLimit;
154 case ThrottleOutPacketType.Texture:
155 return TextureLimit;
156 case ThrottleOutPacketType.Asset:
157 return AssetLimit;
158 case ThrottleOutPacketType.State:
159 return StateLimit;
160 case ThrottleOutPacketType.Unknown:
161 default:
162 return 0;
163 }
164 }
106 } 165 }
107} 166}