aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-08-02 00:00:00 +0100
committerJustin Clark-Casey (justincc)2013-08-02 00:00:00 +0100
commitc9695a0a59cba91a184683efaa7802338d68e4bd (patch)
treefb080c5ba8361478f224d887fb3afd7a834196bf
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-c9695a0a59cba91a184683efaa7802338d68e4bd.zip
opensim-SC_OLD-c9695a0a59cba91a184683efaa7802338d68e4bd.tar.gz
opensim-SC_OLD-c9695a0a59cba91a184683efaa7802338d68e4bd.tar.bz2
opensim-SC_OLD-c9695a0a59cba91a184683efaa7802338d68e4bd.tar.xz
Move experimental attachments throttling further down the chain so that multiple attachments changes (e.g. change outfit) are also throttled
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs31
-rw-r--r--bin/OpenSimDefaults.ini4
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
53 public int DebugLevel { get; set; } 53 public int DebugLevel { get; set; }
54 54
55 /// <summary> 55 /// <summary>
56 /// Period to sleep per 100 prims in order to avoid CPU spikes when an avatar with many attachments logs in 56 /// Period to sleep per 100 prims in order to avoid CPU spikes when an avatar with many attachments logs in/changes
57 /// or many avatars with a medium levels of attachments login simultaneously. 57 /// outfit or many avatars with a medium levels of attachments login/change outfit simultaneously.
58 /// </summary> 58 /// </summary>
59 /// <remarks> 59 /// <remarks>
60 /// A value of 0 will apply no pause. The pause is specified in milliseconds. 60 /// A value of 0 will apply no pause. The pause is specified in milliseconds.
@@ -319,19 +319,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
319 SceneObjectGroup objatt 319 SceneObjectGroup objatt
320 = RezSingleAttachmentFromInventoryInternal( 320 = RezSingleAttachmentFromInventoryInternal(
321 sp, sp.PresenceType == PresenceType.Npc ? UUID.Zero : attach.ItemID, attach.AssetID, attachmentPt, true); 321 sp, sp.PresenceType == PresenceType.Npc ? UUID.Zero : attach.ItemID, attach.AssetID, attachmentPt, true);
322
323
324 if (ThrottlePer100PrimsRezzed > 0)
325 {
326 int throttleMs = (int)Math.Round((float)objatt.PrimCount / 100 * ThrottlePer100PrimsRezzed);
327
328 if (DebugLevel > 0)
329 m_log.DebugFormat(
330 "[ATTACHMENTS MODULE]: Throttling by {0}ms after rez of {1} with {2} prims for attachment to {3} on point {4} in {5}",
331 throttleMs, objatt.Name, objatt.PrimCount, sp.Name, attachmentPt, m_scene.Name);
332
333 Thread.Sleep(throttleMs);
334 }
335 } 322 }
336 catch (Exception e) 323 catch (Exception e)
337 { 324 {
@@ -1023,7 +1010,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1023 } 1010 }
1024 1011
1025 if (tainted) 1012 if (tainted)
1026 objatt.HasGroupChanged = true; 1013 objatt.HasGroupChanged = true;
1014
1015 if (ThrottlePer100PrimsRezzed > 0)
1016 {
1017 int throttleMs = (int)Math.Round((float)objatt.PrimCount / 100 * ThrottlePer100PrimsRezzed);
1018
1019 if (DebugLevel > 0)
1020 m_log.DebugFormat(
1021 "[ATTACHMENTS MODULE]: Throttling by {0}ms after rez of {1} with {2} prims for attachment to {3} on point {4} in {5}",
1022 throttleMs, objatt.Name, objatt.PrimCount, sp.Name, attachmentPt, m_scene.Name);
1023
1024 Thread.Sleep(throttleMs);
1025 }
1027 1026
1028 return objatt; 1027 return objatt;
1029 } 1028 }
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 @@
710 Enabled = true 710 Enabled = true
711 711
712 ; Controls the number of milliseconds that are slept per 100 prims rezzed in attachments 712 ; Controls the number of milliseconds that are slept per 100 prims rezzed in attachments
713 ; Experimental setting to control CPU spiking when avatars with many attachments login 713 ; Experimental setting to control CPU spiking when avatars with many attachments login/change outfit
714 ; or when multiple avatars with medium level attachments login simultaneously. 714 ; or when multiple avatars with medium level attachments login/change outfit simultaneously.
715 ; If 0 then no throttling is performed. 715 ; If 0 then no throttling is performed.
716 ThrottlePer100PrimsRezzed = 0; 716 ThrottlePer100PrimsRezzed = 0;
717 717