InDesign Server Jobs are tasks in Studio Server that are assigned to one of the configured instances of InDesign Server.
Examples: Creating or refreshing a layout preview in the Print editor of Studio, generating folio files, generating PDF files, and so on.
An InDesign Server Job can be one of two types:
- Foreground job. These have priority over Background jobs and (when sufficient InDesign Servers are available) will be processed first. The Print editor of Studio for example uses this job to create previews.
- Background job.These have less priority and will only immediately be processed when an InDesign Server is available. If no Server is available or when all Servers are processing Foreground jobs, the job will be queued. Background jobs are usually jobs that are initiated by Studio Server plug-ins and external applications.
Controllers delegate each job between the available Servers. When a job — of either type — enters the system for processing, a Controller will check for available Servers. If a Server is available, the job will be processed straight away. If no Server is available, what happens next depends on the type of job that needs to be processed:
- Foreground job. The Controller will check for an available Server up to 5 times, with a sleep time of 1 second. If no Server is found, the job times out.
- Background job. Will be placed in a queue until a Server is available.
When a Server is available for background jobs, additional background Controllers are created, one for each job (up to the total number of available Servers). Pending jobs are processed by priority (see below).
This process is shown in the following figure, where 4 simultaneous jobs enter the system with 3 InDesign Servers available:
- Job 1 is a foreground job — and thereby treated with highest priority — and is sent immediately by its Controller to the first available Server for processing.
- Job 2 and Job 3 are background jobs and since 2 more InDesign Servers are available and free, are sent by their Controllers to the Server for immediate processing.
- Job 4 is a background job and is placed in a queue since no Server is available for processing.
When multiple Jobs enter the system, it makes sense to process some Jobs before others.
Example: To keep the waiting time for a user of Studio as low as possible, generating a layout preview should be treated as more important than processing a request for generating a PDF.
To achieve this, the following system is put into place:
- Jobs are assigned a priority, ranging from very high to very low.
- Jobs with a higher priority than others will be processed first.
- Instances of InDesign Server can be set up to only handle Jobs of a specific priority so that jobs with a matching priority will be routed to those server instances.
In essence, this system is a combination of a priority mechanism and a routing mechanism.
In the following setup, 3 InDesign Server instances exist. Each instance handles Jobs of different priorities.
When Jobs of a specific priority enter the system, they are routed to the InDesign Server instance that can handle Jobs with such priorities.
Note: The consequence of this logic is that as long as there are (very) high priority jobs in the queue, low priority jobs are not picked up if all your InDesign Server instance have the ‘Very high’ or ‘High’ option selected.
This could easily happen because the ‘WEB-EDITOR’ jobs (article previews) are marked as very high priority while IDS_AUTOMATION jobs (generating page previews and PDF files) have low priority.
When many editors are editing articles in Studio, many article previews will be generated. The outcome would be that IDS_AUTOMATION jobs will be constantly re-planned.
To prevent that jobs are not processed, we advice to have a mix of priorities on the InDesign Server instances.
Example: Have one or more instances with only the ‘Very high’ and ‘High’ priority selected to generate the article previews without delay. Have one or more instances with only the ‘Low’ and ‘Very low’ priority selected to ensure that jobs to generate page previews and PDF files are processed. And finally maybe have some instances with all priorities selected that can be used for both type of jobs depending on the demand.
- 8 June 2023: Added a note about the consequence of the priority logic.