Background Task
Enhancements on the centralized Background Task system that replaces the decentralized Microsoft Message Queuing (MSMQ) system.
General
- Database centralized Xml Settings configuration (\Websites\Author\EnterViaUI\Admin.XMLBackgroundTaskConfiguration.xml), so a single point of configuration. Through Windows environment variable settings, we still allow per server changes. On top you can set extra environment variables like installation paths in \Applications\BackgroundTask\Bin\BackgroundTask.exe.config.
- Matrix based polling with maximum executions per message type, server or server role - if desired. By default we will restrict the number of publish operations to 2 in parallel, but we will at the same time also allow 2 translation management operations, a synchronize and 2 other (customer) types. So in this example up to 7 tasks are handled in parallel allowing various message types to make progress. Configuring the number of parallel executions protects the available server resources.
- Scalability and fairness based on the central database queue.
- The basic principle is that a background task will be leased. This allows lease refreshes, lease time outs and hence recoveries without administrator interventions.
All programmer's interfaces are now fully natively .NET. In 11.0.0 we introduced IWrite* plugins as replacement for IOnDocStore and ICustomerFunction. Now we introduce IBackgroundTaskHandler to replace IEventHandler.
Improved polling increases BatchImport and PushTranslation throughput
The BackgroundTask service poller sleeps a configured interval (by default 10s) if all slots in all groups are occupied or when there are no tasks waiting to be executed. Some COM+ handlers like PushTranslation and BatchImport work with a single task they continuously resubmit which causes in practice that the sleep interval is always triggered. So effectively a slow down of these background tasks services as a BatchImport file import for example takes less than the 10 seconds sleep time. [TS-8977|TS-8799]
As a general improvement, the poller will now be activated when a slot is freed up from a group. For the above example it means that the resubmitted task of a BatchImport will almost immediately be picked up again increasing throughput.
On top of this throughput improvement we changed the out-of-the-box XMLBackgroundTaskConfiguration.xml ISHBATCHIMPORT @isolationLevel value from Process to None. This avoids starting a new process for every file that needs importing; this could only be done by adjusting the logging engine to avoid file lock issues.
BackgroundTask isolationLevel AppDomain added
IBackgroundTaskHandler configured through the @isolationLevel attribute can now be driven through these variations:
None; meaning that the code is directly loaded and executed by the BackgroundTask service (BackgroundTask.exe).Process; meaning that the code is directly loaded and executed by a new child process of the BackgroundTask service (BackgroundTaskIso.exe).AppDomain; meaning that the code is loaded in a separate .NET application domain (for the background task id) and then executed by the BackgroundTask service (BackgroundTask.exe). When the execution finishes this domain is unloaded, to release all resources loaded in the domain. [TS-8989|TS-8350]