From d842f835a6c74e14175e26277ec3fb1c4d6b30ea Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 23 Oct 2018 10:27:09 +0100 Subject: [PATCH] remove ThrottlePer100PrimsRezzed option, do not delay attachments with thread.sleep --- .../Avatar/Attachments/AttachmentsModule.cs | 53 +------------------ bin/OpenSimDefaults.ini | 6 --- 2 files changed, 2 insertions(+), 57 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index e175db49b6..6861272f99 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -54,15 +54,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments public int DebugLevel { get; set; } - /// - /// Period to sleep per 100 prims in order to avoid CPU spikes when an avatar with many attachments logs in/changes - /// outfit or many avatars with a medium levels of attachments login/change outfit simultaneously. - /// - /// - /// A value of 0 will apply no pause. The pause is specified in milliseconds. - /// - public int ThrottlePer100PrimsRezzed { get; set; } - private Scene m_scene; private IInventoryAccessModule m_invAccessModule; @@ -80,8 +71,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (config != null) { Enabled = config.GetBoolean("Enabled", true); - - ThrottlePer100PrimsRezzed = config.GetInt("ThrottlePer100PrimsRezzed", 0); } else { @@ -112,17 +101,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments + " >= 1 - turns on attachment message debug logging", HandleDebugAttachmentsLog); - MainConsole.Instance.Commands.AddCommand( - "Debug", - false, - "debug attachments throttle", - "debug attachments throttle ", - "Turn on attachments throttling.", - "This requires a millisecond value. " + - " == 0 - disable throttling.\n" - + " > 0 - sleeps for this number of milliseconds per 100 prims rezzed.", - HandleDebugAttachmentsThrottle); - MainConsole.Instance.Commands.AddCommand( "Debug", false, @@ -151,27 +129,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } } - private void HandleDebugAttachmentsThrottle(string module, string[] args) - { - int ms; - - if (args.Length == 4 && int.TryParse(args[3], out ms)) - { - ThrottlePer100PrimsRezzed = ms; - MainConsole.Instance.OutputFormat( - "Attachments rez throttle per 100 prims is now {0} in {1}", ThrottlePer100PrimsRezzed, m_scene.Name); - - return; - } - - MainConsole.Instance.OutputFormat("Usage: debug attachments throttle "); - } - private void HandleDebugAttachmentsStatus(string module, string[] args) { MainConsole.Instance.OutputFormat("Settings for {0}", m_scene.Name); MainConsole.Instance.OutputFormat("Debug logging level: {0}", DebugLevel); - MainConsole.Instance.OutputFormat("Throttle per 100 prims: {0}ms", ThrottlePer100PrimsRezzed); } /// @@ -211,6 +172,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments public void RegionLoaded(Scene scene) { m_invAccessModule = m_scene.RequestModuleInterface(); + if (!Enabled) + return; } public void Close() @@ -1213,18 +1176,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (tainted) objatt.HasGroupChanged = true; - if (ThrottlePer100PrimsRezzed > 0) - { - int throttleMs = (int)Math.Round((float)objatt.PrimCount / 100 * ThrottlePer100PrimsRezzed); - - if (DebugLevel > 0) - m_log.DebugFormat( - "[ATTACHMENTS MODULE]: Throttling by {0}ms after rez of {1} with {2} prims for attachment to {3} on point {4} in {5}", - throttleMs, objatt.Name, objatt.PrimCount, sp.Name, attachmentPt, m_scene.Name); - - Thread.Sleep(throttleMs); - } - return objatt; } diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index e821c1a707..6429faf31f 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -947,12 +947,6 @@ ; Defaults to true - only set to false for debugging purposes Enabled = true - ; Controls the number of milliseconds that are slept per 100 prims rezzed in attachments - ; Experimental setting to control CPU spiking when avatars with many attachments login/change outfit - ; or when multiple avatars with medium level attachments login/change outfit simultaneously. - ; If 0 then no throttling is performed. - ThrottlePer100PrimsRezzed = 0 - [Mesh] ; enable / disable mesh asset uploads