Move expired objects cleaning trigger to the maintenance thread of a region rather than it's main scene loop.

[Startup] default setting UpdateTempCleaningEveryNFrames becomes UpdateTempCleaningEveryNSeconds.
Default becomes 180s instead of effective 182s (which would also vary with any changes in frame time or extra long frames)
mb-throttle-test
Justin Clark-Casey (justincc) 2014-09-27 00:23:52 +01:00
parent 31c8b7fd1a
commit 530b0cbbf1
2 changed files with 27 additions and 24 deletions

View File

@ -377,13 +377,13 @@ namespace OpenSim.Region.Framework.Scenes
private int m_update_physics = 1; private int m_update_physics = 1;
private int m_update_entitymovement = 1; private int m_update_entitymovement = 1;
private int m_update_objects = 1; private int m_update_objects = 1;
private int m_update_temp_cleaning = 1000;
private int m_update_presences = 1; // Update scene presence movements private int m_update_presences = 1; // Update scene presence movements
private int m_update_events = 1; private int m_update_events = 1;
private int m_update_backup = 200; private int m_update_backup = 200;
private int m_update_terrain = 50; private int m_update_terrain = 50;
// private int m_update_land = 1; // private int m_update_land = 1;
private int m_update_coarse_locations = 50; private int m_update_coarse_locations = 50;
private int m_update_temp_cleaning = 180;
private int agentMS; private int agentMS;
private int frameMS; private int frameMS;
@ -1014,7 +1014,7 @@ namespace OpenSim.Region.Framework.Scenes
m_update_physics = startupConfig.GetInt( "UpdatePhysicsEveryNFrames", m_update_physics); m_update_physics = startupConfig.GetInt( "UpdatePhysicsEveryNFrames", m_update_physics);
m_update_presences = startupConfig.GetInt( "UpdateAgentsEveryNFrames", m_update_presences); m_update_presences = startupConfig.GetInt( "UpdateAgentsEveryNFrames", m_update_presences);
m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain); m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning); m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNSeconds", m_update_temp_cleaning);
} }
// FIXME: Ultimately this should be in a module. // FIXME: Ultimately this should be in a module.
@ -1491,7 +1491,7 @@ namespace OpenSim.Region.Framework.Scenes
public void DoMaintenance(int runs) public void DoMaintenance(int runs)
{ {
long? endRun = null; long? endRun = null;
int runtc; int runtc, tmpMS;
int previousMaintenanceTick; int previousMaintenanceTick;
if (runs >= 0) if (runs >= 0)
@ -1505,6 +1505,8 @@ namespace OpenSim.Region.Framework.Scenes
runtc = Util.EnvironmentTickCount(); runtc = Util.EnvironmentTickCount();
++MaintenanceRun; ++MaintenanceRun;
// m_log.DebugFormat("[SCENE]: Maintenance run {0} in {1}", MaintenanceRun, Name);
// Coarse locations relate to positions of green dots on the mini-map (on a SecondLife client) // Coarse locations relate to positions of green dots on the mini-map (on a SecondLife client)
if (MaintenanceRun % (m_update_coarse_locations / 10) == 0) if (MaintenanceRun % (m_update_coarse_locations / 10) == 0)
{ {
@ -1526,6 +1528,21 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
// Delete temp-on-rez stuff
if (MaintenanceRun % m_update_temp_cleaning == 0 && !m_cleaningTemps)
{
// m_log.DebugFormat("[SCENE]: Running temp-on-rez cleaning in {0}", Name);
tmpMS = Util.EnvironmentTickCount();
m_cleaningTemps = true;
Watchdog.RunInThread(
delegate { CleanTempObjects(); m_cleaningTemps = false; },
string.Format("CleanTempObjects ({0})", Name),
null);
tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpMS);
}
Watchdog.UpdateThread(); Watchdog.UpdateThread();
previousMaintenanceTick = m_lastMaintenanceTick; previousMaintenanceTick = m_lastMaintenanceTick;
@ -1564,7 +1581,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName); // m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName);
agentMS = tempOnRezMS = eventMS = backupMS = terrainMS = landMS = spareMS = 0; agentMS = eventMS = backupMS = terrainMS = landMS = spareMS = 0;
try try
{ {
@ -1617,21 +1634,7 @@ namespace OpenSim.Region.Framework.Scenes
if (Frame % m_update_presences == 0) if (Frame % m_update_presences == 0)
m_sceneGraph.UpdatePresences(); m_sceneGraph.UpdatePresences();
agentMS += Util.EnvironmentTickCountSubtract(tmpMS); agentMS += Util.EnvironmentTickCountSubtract(tmpMS);
// Delete temp-on-rez stuff
if (Frame % m_update_temp_cleaning == 0 && !m_cleaningTemps)
{
tmpMS = Util.EnvironmentTickCount();
m_cleaningTemps = true;
Watchdog.RunInThread(
delegate { CleanTempObjects(); m_cleaningTemps = false; },
string.Format("CleanTempObjects ({0})", Name),
null);
tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpMS);
}
if (Frame % m_update_events == 0) if (Frame % m_update_events == 0)
{ {
@ -1701,7 +1704,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
EventManager.TriggerRegionHeartbeatEnd(this); EventManager.TriggerRegionHeartbeatEnd(this);
otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; otherMS = eventMS + backupMS + terrainMS + landMS;
if (!UpdateOnTimer) if (!UpdateOnTimer)
{ {

View File

@ -180,10 +180,6 @@
; This must be a whole number ; This must be a whole number
UpdatePhysicsEveryNFrames = 1; UpdatePhysicsEveryNFrames = 1;
; Clean up temp on rez objects.
; This must be a whole number
UpdateTempCleaningEveryNFrames = 1000;
; Send out the on frame event to modules and other listeners. This should probably never deviate from 1. ; Send out the on frame event to modules and other listeners. This should probably never deviate from 1.
; This must be a whole number ; This must be a whole number
UpdateEventsEveryNFrames = 1; UpdateEventsEveryNFrames = 1;
@ -196,6 +192,10 @@
; This must be a whole number ; This must be a whole number
UpdateStorageEveryNFrames = 200; UpdateStorageEveryNFrames = 200;
; Clean up temp on rez objects.
; This must be a whole number
UpdateTempCleaningEveryNSeconds = 180;
; ## ; ##
; ## PRIM STORAGE ; ## PRIM STORAGE
; ## ; ##