September 19th, 2021
The OL Connect Server manages engines that extract data, create web pages, emails and print output, in addition to handling other requests. These operations run simultaneously and chances are you’ll never have to worry about the way the server multi-tasks. But if OL Connect is not producing output as fast as your license allows or if you ever had to tweak the ‘scheduling settings’ in the past, it can pay off to look at OL Connect’s multi-tasking settings, starting with the engine setup.
This is the first how-to in a series about OL Connect’s multi-tasking. It focuses on the engine setup. Follow-up how-to’s will dive deeper into the presets and custom settings for parallel processing.
To start with, what does ‘task’ mean in the context of multi-tasking? For the purpose of this article, a ‘task’ refers to a single request to the OL Connect Server to extract data or to create output (email, web or print). Those tasks can be triggered by an OL Connect Workflow plugin, an OL Connect Node-RED stack node, or a direct call to the server using its REST API.
However, stating that the OL Connect Server is multi-tasking doesn’t mean to say it does everything by itself. On the contrary, the server delegates tasks to three different engines:
If the server receives multiple simultaneous requests for the same type of task, it can put several engines to work in parallel. It is up to the OL Connect Server to determine how many engines work in parallel on which type of tasks.
So, how many engines can work in parallel? Let’s examine the engine setup that the OL Connect Server gets out of the box.
A fresh installation will have only one data mapper engine and one output engine. The initial number of merge engines is one less than the number of cores in the system. This leaves one CPU core free for the Connect Server, for the other engines and for the operating system to use.
The number of merge engines is higher because they are involved in the creation of output of all kinds (print, email and web) and content creation can be relatively time-consuming. Having more merge engines generally results in better performance. The more cores available, the better!
The number of engines that the Connect Server can use is not only limited by the engine setup. The license also limits the number of simultaneous requests that the OL Connect Server can handle.
Here is an overview of the maximum number of tasks and the maximum print output speed in pages per minute (print output only) for each license type.
The license limit only applies to requests that create output, and is applied separately for each output type. For instance, with OL Connect Workflow, the license limit impacts the following tasks:
(The same limit also applies to the respective requests when made directly via the REST API.)
As the table above shows, PlanetPress Connect has 6 “licensed tasks”, which means that at most 6 email tasks can be handled by merge engines at the same time, as well as 6 web output tasks and 6 print output tasks. Note that the number of print merge tasks that can run in parallel is not limited as the limit is only applied at output time.
If, for any type of output, the number of simultaneous tasks requested exceeds the maximum allowed by the license, then any additional task is queued up on the server until a running task completes.
Note that the license does not limit the number of engines itself. It only limits how many of them can produce the same type of output at the same time.
We already said it is up to the OL Connect Server to determine how many engines can work in parallel on any specific task. This determination relies on the Parallel Processing settings, so let’s have a look at those. Note that the terms Output Engine and Weaver Engine are equivalent.
They can be found in the Connect Server Configuration tool, on the Parallel Processing tab.
When parallel processing is set to Default, the ‘Multi-tasking’ option is set to ‘Optimize per task’, and no engines are kept in reserve for any type of task. This means the OL Connect Server launches tasks in a first-in, first-out (FIFO) order. This default setup will work well in most cases, such as for the following scenarios:
If the default setup works for you, then you don’t have to change anything! But what if it doesn’t?
You should first try to adjust the number of engines. A good rule of thumb is to look at the number of cores that your system has. It usually does not make sense to run many more engines of a certain type than there are cores available in the system.
But engines only use cores when they are active, and it happens frequently that engines of different types do not run concurrently. For example, many processes perform content creation and output creation in sequence. So if you don’t expect different types of engines to run tasks simultaneously, you could very well configure as many engines of each type as there are cores in the system.
Still, this does not mean you should always specify as many engines as the number of system cores. Remember that an engine always takes up memory, whether it is being used or not. You should always allow for the system to maintain a healthy amount of free memory, or else it might slow down.
A few more tips:
If the setup still doesn’t work as well as you’d expect, then it might make sense to change the Parallel Processing settings from Default to one of the other presets, or even to make custom settings.
The next how-to explains the differences between Parallel Processing presets, and when to use them: Multi-Tasking 2: Parallel Processing Presets.