HomeGuidesRecipesAPI
HomeGuidesAPILog In

Using Scheduler

Overview

The SmartIQ Scheduler is by default a Windows service that checks and executes a collection of jobs due for completion at regular intervals indefinitely until closed. Windows services are registered once on a server, so it supports one SmartIQ environment only.

For instructions, Installing Scheduler see SmartIQ Scheduler Install.

Scheduled project definitions can be edited from the Manage > Management menu. Select the Definitions button to see a list of all defined scheduled tasks and their next run date and time (if they are a recurring project or scheduled for the future).

From here you can click on the Definition name to edit the definition and view the details of the task run history. When editing a definition you can only change the name and whether the task is enabled or not. If you need to change the run times and/or intervals you will need to delete the task and recreate it.

Disabling a task

If you disable a task it will cease to run. However the scheduler will continue to process the task and update the potential next run time if the task it recurring.

Enabling a task

If you re-enable a task, be careful. Check the next run date in the Definitions list before enabling a task. If the next run date is in the past when you re-enable the task the scheduler will process the task as soon as it next runs. It is best to wait until just after the next time the scheduler is set to run, so a future date is calculate, and then re-enable the task. The task will then run at the future date set.

How often the run date will be recalculated depends on how the scheduler is configured.

Past run dates for which a task was disabled at the run time are not "queued" for future execution when the task is enabled, they are discarded at run time.

Running multiple instances of the scheduler on one server

For servers hosting multiple instances of SmartIQ the scheduler application (or multiple instances thereof) can be run from the command line using a "-console" parameter. When using the "-console" parameter the service will run all tasks due for completion at that point in time and then immediately exit.

The console mode allows scheduling tools such as Windows Task Scheduler to process the due tasks on an ad-hoc or timed basis.

πŸ“˜

Note:

Chosen Scheduler tools should not overlap executions of the IntelledoxScheduler.

For the service to run in β€œconsole” mode pass the -console parameter at execution time as in the examples below:

IntelledoxScheduler.exe -console

435435

Multi threaded execution

Scheduler can use multiple threads when running scheduled projects and escalations.

This typically won't cause any issues but you may want to review what your projects and esclations are doing and whether they are thread safe before enabling multi threaded execution.

The number of cpus in use is controlled via a configuration option in appsettings.json.

{
  "AppSettings": {
    "ConcurrentThreads": 3
  }
}

Server load can be limited by entering a value relative to the amount of cpu cores the machine has.
If the configuration option is missing the default is half the number of hyper-threaded cores. eg 4 core cpu has 8 hyper-threads, Scheduler will use 4 threads.

Setting the value to 1 will disable threading and run as before.

{
  "AppSettings": {
    "ConcurrentThreads": 1
  }
}

On a simple project multi-threading will result in a 2x throughput increase.

Enable a verbose logging option on the scheduler

A logging option has been added to the Appsettings section of the appsettings.json file for the scheduler. It has two possible values:

  • Verbose: writes to the Evenlog table details of what steps the scheduler is taking and any actions and results.
  • VerboseWithTransactions: writes to the Evenlog table details included for verbose plus details of every item added or removed (this could create a very very large log, so use with caution).

Snippet to add Verbose

"AppSettings": {
      "Logging":  "Verbose"
},

Snippet to add VerboseWithTransactions

"AppSettings": {
      "Logging":  "VerboseWithTransactions"
},

Logging scheduler to Windows Event Log

A parameter can be added to the executable call for the scheduler in conjunction with the -console parameter to push the results of the logging to the Windows Event Log.

The parameter is -eventlog

For the service to run in console mode with logging in the Windows Event Log pass the -console parameter and the -eventlog parameter at execution time as in the examples below:

IntelledoxScheduler.exe -console -eventlog