diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 97477d49f1..675fccc6e5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -53,8 +53,8 @@ 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 - /// or many avatars with a medium levels of attachments login simultaneously. + /// 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. @@ -319,19 +319,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments SceneObjectGroup objatt = RezSingleAttachmentFromInventoryInternal( sp, sp.PresenceType == PresenceType.Npc ? UUID.Zero : attach.ItemID, attach.AssetID, attachmentPt, 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); - } } catch (Exception e) { @@ -1023,7 +1010,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } if (tainted) - objatt.HasGroupChanged = true; + 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 2488bf16f0..d5d29ec674 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -710,8 +710,8 @@ 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 - ; or when multiple avatars with medium level attachments login simultaneously. + ; 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;