diff options
author | Justin Clark-Casey (justincc) | 2014-10-10 23:36:50 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-11-25 23:21:38 +0000 |
commit | d33964222aa9e3b2e639469a32d0af4728b0f77d (patch) | |
tree | e92451eeaf3df6d449b1b08155bbb660eb8e78e5 /OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |
parent | Use automatic properties for Parent and TotalDripRequest in TokenBucket to ma... (diff) | |
download | opensim-SC-d33964222aa9e3b2e639469a32d0af4728b0f77d.zip opensim-SC-d33964222aa9e3b2e639469a32d0af4728b0f77d.tar.gz opensim-SC-d33964222aa9e3b2e639469a32d0af4728b0f77d.tar.bz2 opensim-SC-d33964222aa9e3b2e639469a32d0af4728b0f77d.tar.xz |
Fix an issue where specifying both max client and server outgoing UDP throttles would cause client throttles to be lower than expected when total requests exceeded the scene limit.
This was because specifying a max client throttle would always request the max from the parent server throttle, no matter the actual total requests on the client throttle.
This would lead to a lower server multiplier than expected.
This change also adds a 'target' column to the "show throttles" output that shows the target rate (as set by client) if adaptive throttles is active.
This commit also re-adds the functionality lost in recent 5c1a1458 to set a max client throttle when adaptive is active.
This commit also adds TestClientThrottlePerClientAndRegionLimited and TestClientThrottleAdaptiveNoLimit regression tests
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index 6864d37..c768662 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |||
@@ -229,7 +229,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
229 | m_throttleClient | 229 | m_throttleClient |
230 | = new AdaptiveTokenBucket( | 230 | = new AdaptiveTokenBucket( |
231 | string.Format("adaptive throttle for {0} in {1}", AgentID, server.Scene.Name), | 231 | string.Format("adaptive throttle for {0} in {1}", AgentID, server.Scene.Name), |
232 | parentThrottle, rates.Total, rates.AdaptiveThrottlesEnabled); | 232 | parentThrottle, 0, rates.Total, rates.AdaptiveThrottlesEnabled); |
233 | 233 | ||
234 | // Create an array of token buckets for this clients different throttle categories | 234 | // Create an array of token buckets for this clients different throttle categories |
235 | m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT]; | 235 | m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT]; |
@@ -247,7 +247,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
247 | m_throttleCategories[i] | 247 | m_throttleCategories[i] |
248 | = new TokenBucket( | 248 | = new TokenBucket( |
249 | string.Format("{0} throttle for {1} in {2}", type, AgentID, server.Scene.Name), | 249 | string.Format("{0} throttle for {1} in {2}", type, AgentID, server.Scene.Name), |
250 | m_throttleClient, rates.GetRate(type)); | 250 | m_throttleClient, rates.GetRate(type), 0); |
251 | } | 251 | } |
252 | 252 | ||
253 | // Default the retransmission timeout to one second | 253 | // Default the retransmission timeout to one second |
@@ -293,6 +293,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
293 | m_info.assetThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Asset].DripRate; | 293 | m_info.assetThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Asset].DripRate; |
294 | m_info.textureThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Texture].DripRate; | 294 | m_info.textureThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Texture].DripRate; |
295 | m_info.totalThrottle = (int)m_throttleClient.DripRate; | 295 | m_info.totalThrottle = (int)m_throttleClient.DripRate; |
296 | m_info.targetThrottle = (int)m_throttleClient.TargetDripRate; | ||
296 | m_info.maxThrottle = (int)m_throttleClient.MaxDripRate; | 297 | m_info.maxThrottle = (int)m_throttleClient.MaxDripRate; |
297 | 298 | ||
298 | return m_info; | 299 | return m_info; |
@@ -441,28 +442,36 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
441 | } | 442 | } |
442 | 443 | ||
443 | // Update the token buckets with new throttle values | 444 | // Update the token buckets with new throttle values |
444 | TokenBucket bucket; | 445 | if (m_throttleClient.AdaptiveEnabled) |
446 | { | ||
447 | long total = resend + land + wind + cloud + task + texture + asset; | ||
448 | m_throttleClient.TargetDripRate = total; | ||
449 | } | ||
450 | else | ||
451 | { | ||
452 | TokenBucket bucket; | ||
445 | 453 | ||
446 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Resend]; | 454 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Resend]; |
447 | bucket.RequestedDripRate = resend; | 455 | bucket.RequestedDripRate = resend; |
448 | 456 | ||
449 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Land]; | 457 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Land]; |
450 | bucket.RequestedDripRate = land; | 458 | bucket.RequestedDripRate = land; |
451 | 459 | ||
452 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Wind]; | 460 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Wind]; |
453 | bucket.RequestedDripRate = wind; | 461 | bucket.RequestedDripRate = wind; |
454 | 462 | ||
455 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Cloud]; | 463 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Cloud]; |
456 | bucket.RequestedDripRate = cloud; | 464 | bucket.RequestedDripRate = cloud; |
457 | 465 | ||
458 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Asset]; | 466 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Asset]; |
459 | bucket.RequestedDripRate = asset; | 467 | bucket.RequestedDripRate = asset; |
460 | 468 | ||
461 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Task]; | 469 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Task]; |
462 | bucket.RequestedDripRate = task; | 470 | bucket.RequestedDripRate = task; |
463 | 471 | ||
464 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Texture]; | 472 | bucket = m_throttleCategories[(int)ThrottleOutPacketType.Texture]; |
465 | bucket.RequestedDripRate = texture; | 473 | bucket.RequestedDripRate = texture; |
474 | } | ||
466 | 475 | ||
467 | // Reset the packed throttles cached data | 476 | // Reset the packed throttles cached data |
468 | m_packedThrottles = null; | 477 | m_packedThrottles = null; |