Move experimental attachments throttling further down the chain so that multiple attachments changes (e.g. change outfit) are also throttled

TeleportWork
Justin Clark-Casey (justincc) 2013-08-02 00:00:00 +01:00
parent 7a5d11f8a7
commit c9695a0a59
2 changed files with 17 additions and 18 deletions

View File

@ -53,8 +53,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
public int DebugLevel { get; set; }
/// <summary>
/// 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.
/// </summary>
/// <remarks>
/// 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;
}

View File

@ -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;