From 7965b6eb611be5f1a3cc75b2f8e3f3b76c87ffa0 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 30 Oct 2009 00:43:46 -0700 Subject: [PATCH] * Moving parcel media and avatar update packets from the unthrottled category to task * Fixing a bug where the max burst rate for the state category was being set as unlimited, causing connections to child agents to saturate bandwidth * Upped the example default drip rates to 1000 bytes/sec, the minimum granularity for the token buckets --- .../ClientStack/LindenUDP/LLClientView.cs | 11 ++++++---- .../ClientStack/LindenUDP/LLUDPClient.cs | 3 --- .../ClientStack/LindenUDP/LLUDPServer.cs | 12 +++++++---- .../ClientStack/LindenUDP/ThrottleRates.cs | 21 +++++++++---------- bin/OpenSim.ini.example | 14 ++++++------- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 992d06fde6..b8c99cf445 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -1856,7 +1856,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP economyData.Info.TeleportMinPrice = TeleportMinPrice; economyData.Info.TeleportPriceExponent = TeleportPriceExponent; economyData.Header.Reliable = true; - OutPacket(economyData, ThrottleOutPacketType.Unknown); + OutPacket(economyData, ThrottleOutPacketType.Task); } public void SendAvatarPickerReply(AvatarPickerReplyAgentDataArgs AgentData, List Data) @@ -3234,7 +3234,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue(); } - OutPacket(terse, ThrottleOutPacketType.Unknown); // HACK: Unthrottled for testing + // HACK: Using the task category until the tiered reprioritization code is in + OutPacket(terse, ThrottleOutPacketType.Task); } public void SendCoarseLocationUpdate(List users, List CoarseLocations) @@ -4951,6 +4952,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// Throttling category for the packet protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType) { + if (ChildAgentStatus()) + Thread.Sleep(200); m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, true); } @@ -9843,7 +9846,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP commandMessagePacket.CommandBlock.Command = (uint)command; commandMessagePacket.CommandBlock.Time = time; - OutPacket(commandMessagePacket, ThrottleOutPacketType.Unknown); + OutPacket(commandMessagePacket, ThrottleOutPacketType.Task); } public void SendParcelMediaUpdate(string mediaUrl, UUID mediaTextureID, @@ -9861,7 +9864,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP updatePacket.DataBlockExtended.MediaHeight = mediaHeight; updatePacket.DataBlockExtended.MediaLoop = mediaLoop; - OutPacket(updatePacket, ThrottleOutPacketType.Unknown); + OutPacket(updatePacket, ThrottleOutPacketType.Task); } #endregion diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs index 84a495959a..6619dcb258 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs @@ -135,8 +135,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP private readonly TokenBucket m_throttle; /// Throttle buckets for each packet category private readonly TokenBucket[] m_throttleCategories; - /// Throttle rate defaults and limits - private readonly ThrottleRates m_defaultThrottleRates; /// Outgoing queues for throttled packets private readonly OpenSim.Framework.LocklessQueue[] m_packetOutboxes = new OpenSim.Framework.LocklessQueue[THROTTLE_CATEGORY_COUNT]; /// A container that can hold one packet for each outbox, used to store @@ -161,7 +159,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP RemoteEndPoint = remoteEndPoint; CircuitCode = circuitCode; m_udpServer = server; - m_defaultThrottleRates = rates; // Create a token bucket throttle for this client that has the scene token bucket as a parent m_throttle = new TokenBucket(parentThrottle, rates.TotalLimit, rates.Total); // Create an array of token buckets for this clients different throttle categories diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 9792bcd824..cc06a8549e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -409,6 +409,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP SendPacket(udpClient, pc, ThrottleOutPacketType.Unknown, false); } + public void CompletePing(LLUDPClient udpClient, byte pingID) + { + CompletePingCheckPacket completePing = new CompletePingCheckPacket(); + completePing.PingID.PingID = pingID; + SendPacket(udpClient, completePing, ThrottleOutPacketType.Unknown, false); + } + public void ResendUnacked(LLUDPClient udpClient) { if (!udpClient.IsConnected) @@ -669,10 +676,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { // We don't need to do anything else with ping checks StartPingCheckPacket startPing = (StartPingCheckPacket)packet; - - CompletePingCheckPacket completePing = new CompletePingCheckPacket(); - completePing.PingID.PingID = startPing.PingID.PingID; - SendPacket(udpClient, completePing, ThrottleOutPacketType.Unknown, false); + CompletePing(udpClient, startPing.PingID.PingID); return; } else if (packet.Type == PacketType.CompletePingCheck) diff --git a/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs b/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs index 008d827e20..aaf6e26d58 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs @@ -87,15 +87,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP IConfig throttleConfig = config.Configs["ClientStack.LindenUDP"]; 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); - State = throttleConfig.GetInt("state_default", 500); - - Total = throttleConfig.GetInt("client_throttle_max_bps", 0); + 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); @@ -104,9 +102,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP TaskLimit = throttleConfig.GetInt("task_limit", 18750); TextureLimit = throttleConfig.GetInt("texture_limit", 55750); AssetLimit = throttleConfig.GetInt("asset_limit", 27500); - State = throttleConfig.GetInt("state_limit", 37000); + StateLimit = throttleConfig.GetInt("state_limit", 37000); - TotalLimit = throttleConfig.GetInt("client_throttle_max_bps", 0); + Total = throttleConfig.GetInt("client_throttle_max_bps", 0); + TotalLimit = Total; } catch (Exception) { } } diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 3952e2db78..6606270b00 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -399,13 +399,13 @@ ; These are default values that will be overriden by clients ; ;resend_default = 12500 - ;land_default = 500 - ;wind_default = 500 - ;cloud_default = 50 - ;task_default = 500 - ;texture_default = 500 - ;asset_default = 500 - ;state_default = 500 + ;land_default = 1000 + ;wind_default = 1000 + ;cloud_default = 1000 + ;task_default = 1000 + ;texture_default = 1000 + ;asset_default = 1000 + ;state_default = 1000 ; Per-client maximum burst rates in bytes per second for the various ; throttle categories. These are default values that will be overriden by