Scheduler daemon

A scheduler daemon is a background thread that searches for tasks to run in the database.

A scheduler daemon is started for each scheduler defined on each server. If Scheduler 1 is configured on server1, then only one scheduler daemon runs on server1 unless it is cloned. If Scheduler 1 is defined at the node scope level, then the scheduler will run on each server within that node.

The poll interval determines the frequency at which the persistent store is queried. By default, this value is set to 30 seconds. When a task is found that is scheduled to run within the current poll interval, an asynchronous beans alarm is set. The task then runs as close to this time as possible using an alarm thread from the scheduler's associated work manager. Thus, the number of alarm threads configured on the work manager determines how many concurrent tasks are executed. No tasks are lost. If we reach this limit, then new tasks are simply queued to be executed when an alarm thread becomes available. The actual firing time is dictated by server load and availability of free threads in the alarm thread pool of the associated work manager.

The number of tasks that the scheduler daemon can process depends on various factors. The performance of the environment must be high enough and the poll cycle must be long enough so that all the tasks are read within the poll cycle. The server and the database must also be able to handle the load within the poll cycle. The scheduler daemon caps the number of tasks that can be read within a poll cycle to a value that is far more than needed in typical usage.

Scheduler daemons in a cluster

When multiple schedulers are configured to use the same tables (as is the case in a clustered environment), any of the daemons can find a task and set the alarm in its Java™ virtual machine (JVM). The task is executed in the virtual machine where the scheduler daemon first runs, until the daemon is stopped and another daemon starts. If an application on server1 schedules a task to run and server2 was started before server1, then the task runs on server2.

If this is not the desired behavior, you can add the daemonAutoStart scheduler custom property to your scheduler settings. Setting this property to false prevents the associated scheduler deamon from starting during server startup. To add this property to your scheduler settings:
  1. In the administrative console, click Resources > Schedulers.
  2. Select either an existing scheduler from collection or create a new scheduler.
  3. Under Additional Properties, select Custom Properties, and then click New.
  4. Specify daemonAutoStart in the Name field and, depending on whether you want to enable or disable this function, specify either false or true in the Value field.

    You can specify a description of this custom property in the Description field, but this field is not required.

  5. Set Type to java.lang.String. java.lang.String is the default setting for this field.
  6. Click OK , and then click Save to save your configuration changes.
  7. Restart the server.

To re-enable the autostart of a scheduler, change the value of the custom property to true or delete the custom property from your scheduler configuration settings. After you change the value of this property or delete this property from your scheduler configuration settings, you must save the configuration and restart the server.

The default value for the daemonAutoStart property is true.