From c9695a0a59cba91a184683efaa7802338d68e4bd Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 2 Aug 2013 00:00:00 +0100
Subject: Move experimental attachments throttling further down the chain so
that multiple attachments changes (e.g. change outfit) are also throttled
---
.../Avatar/Attachments/AttachmentsModule.cs | 31 +++++++++++-----------
bin/OpenSimDefaults.ini | 4 +--
2 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 97477d4..675fccc 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 2488bf1..d5d29ec 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;
--
cgit v1.1