[SCHEDULER-287]  Optimize Monitor Mode Query
Type Enhancement
Priority Low
Severity Trivial
Component Dispatch Scheduler Engine
Fixed In Version [3.33.3
Versions Affected [3.13.1
Severity Closed
Resolution Complete
Reported By Bob Denny
Resources Bob Denny
Start Date 11/25/2010

Description
Currently the Monitor Mode query gets all of the plans then looks through them all for those with MonitorInterval > 0. Change this to use a query with MonitorInterval>0 as a constraint in the SQL. This will greatly reduce the overhead, which happens each schedule pass.

Comments
11/26/2010 6:30:03 PM   Bob Denny
SVN Comment
Author rbdenny
Repository svn+ssh://rbdenny@a2_svn_dc3/home/rbdenny/svn/astro/scheduler
SVN Revision 114
Affected files /trunk/Scheduler/Engine.cs (Modified)
Check-in comment Oops, found another instance of not "failing": Plan as Complete. GEM:287
11/26/2010 6:07:04 PM   Bob Denny
SVN Comment
Author rbdenny
Repository svn+ssh://rbdenny@a2_svn_dc3/home/rbdenny/svn/astro/scheduler
SVN Revision 112
Affected files /trunk/Database/Database.cs (Modified)
/trunk/Empty SchedulerData.mdb (Modified)
/trunk/Help/RelNotes.htm (Modified)
/trunk/Scheduler/Engine.cs (Modified)
/trunk/SchedulerSetup/Custom Actions/UpdateDatabase.vbs (Modified)
Check-in comment More improvements, filter in query now GEM:287
11/26/2010 2:15:47 PM   Bob Denny
Reopened:
  1. The addition of the new Query and upgrade to 2.1 is not in the Custom Action for the installer.
  2. The Database object needs to look for V2.1
  3. The Monitor Mode query returns plans for which Monitor Mode is > 1 but whose resubmit time has not yet expired (of course). Try to make this part of the query for better efficiency yet!
11/26/2010 11:14:29 AM   Bob Denny
SVN Comment
Author rbdenny
Repository svn+ssh://rbdenny@a2_svn_dc3/home/rbdenny/svn/astro/scheduler
SVN Revision 109
Affected files /trunk/Database/Database.cs (Modified)
/trunk/Empty SchedulerData.mdb (Modified)
/trunk/Help/RelNotes.htm (Modified)
/trunk/Scheduler/Engine.cs (Modified)
Check-in comment Fix Monitor Mode for 24/7, improve efficiency. GEM:287
11/26/2010 9:45:23 AM   Bob Denny
Query logic is simple, select plans that are either Complete (3) or Failed (4), and have MonitorInterval > 1. If these are met, just resubmit. Any "Latest" time will be taken care of at the time the dispatcher decides to start the Plan. If, by then, the Plan has gone beyond its Latest time, it will not be started and this fact will be logged.

Move the Monitor Mode restart into the Schedule Pass, so it will run even if the dispatcher remains enabled 24/7. 
11/25/2010 4:44:27 PM   Bob Denny
509 went away. But this still needs to be moved into the Schedule pass and optimized. As it is, Monitor targets won't get activated unless the dispatcher transitions from stopped to running. They won't get submitted by a 24/7 scheduler that leaves the dispatcher running all the time. Furthermore, the current algorithm for deciding when to resubmit is flawed. Revisit this.

At a minimum, create a new query PlansWithMonitorInterval which will get only plans with MonitorInterval > 0. That will reduce the time in the decision loop. But try to get even smarter in the query.
11/25/2010 3:30:10 PM   Bob Denny
Turned into a requirement for SCHEDULER-509, as this is going innside the schedule pass now and efficiency it much more important.