Background Processing with Decisions Enterprise
- Updated on 27 Nov 2018
- 2 minutes to read
Background processing is handled in Decisions by putting work into queues and having Decisions servers work on tasks in those queues. If you have the Decisions Enterprise module installed then you have complete control over how the queues behave in your environment.
There are two main Decisions features that make use of work queues:
Scheduled Jobs (This includes systematic scheduled jobs like task reminders)
Background workflows (otherwise known as Async workflows or “Fire and Forget” in older releases)
Whenever one of these features is leveraged their work task is stored in a queue. Decisions has one queue, the Default Queue, when installed. To configure additional queues you must be an administrator and navigate to: /System/Jobs and Events/Work Queue Types as shown in Figure 5 - Adding and Editing Work Queues.
Figure 5 - Adding and Editing Work Queues
Once you have added multiple queues, you can specify which servers in your Decisions cluster are allowed to work on each of the queues of work. This allows you to dictate what kinds of background processing each of the servers may be responsible for. This is commonly used to create a ‘background processing’ machine which isn't connected to the load balancer and is not used for user interaction but works very hard on queued tasks and batch processes. Selecting the queues a server is allowed to pull work from is done in /System/Administration/Servers. You select a server, and select ‘Edit Server.’ This will present you with the dialog shown in Figure 6 - Specifying Queues for a Server.
Figure 6 - Specifying Queues for a Server
In addition to constraining servers to work on specific queues you can also designate different worker profiles that govern how each server in the cluster addresses work that is stored in the queues. Worker profiles are maintained and edited at /System/Jobs and Events/Work Queue Workers as shown in Figure 7 - Configuring a Worker Profile.
Figure 7 - Configuring a Worker Profile
The dialog shown above has several settings. These settings control the detailed behavior for any Decisions server that is assigned to this profile.
1. WorkQueueProfileName: The name of the profile. This should be something meaningful so that you know which servers should be assigned to that profile.
2. CheckTimespanWhenActive: This is the amount of time that will pass between checks for new work in the queue when the worker is already active and has been processing work from the queue.
3. CheckTimespanWhenInactive: This is the amount of time that will pass between checks for new work in the queue when the application server hasn't had any work to work on lately.
4. PickupItemsOlderThan: This setting specifies the minimum age of a task in the queue that this worker profile is allowed to pick up and work on. The purpose of this setting is to allow you to have servers that do not normally work on background processes to get involved only when the work queue is getting backed up and the servers that address work more aggressively are taking too long to get to tasks in the queue.
5. WorkerThreads: This is the number of threads that the Decisions platform will be allowed to commit to background processing. The right value for this number depends on your hardware and the type of processing that you are doing.