Prioritization
In Sitecore Content Hub, processing jobs perform a variety of tasks, such as generating renditions, creating download orders, and processing renditions after an upload. It is the prioritization that decides which processing work is handled first.
A simple method of prioritization is to add jobs in the order they are created, so they are processed in that order. This is sometimes known as first in, first out. In practice, however, job processing is more complex and uses sequential job queues to complete tasks. For example, if you request a download when there is already a large file import job in the queue, your download is delayed until the large job is completed. To avoid bottlenecks, Content Hub assigns a priority to each new processing job.
This means that small processing jobs, including download orders, are assigned a high priority and are therefore processed faster. Larger jobs, such as Excel file imports, are assigned the lowest priority and are processed only when no higher priority jobs are pending.
Priority levels
A job contains one or more targets and each job is assigned a priority based on its type:
|
Job type |
Priority |
|---|---|
|
Download orders |
10 (highest) |
|
Generate user renditions |
8 |
|
Uploads through the user interface |
5 |
|
Metadata processing of archives (for example, the file structure) |
5 |
|
Link a media matrix to an existing asset |
5 |
|
Enrich with AI |
4 |
|
Process files originating from an archive |
1 |
|
Refresh renditions |
1 |
|
Fetch a file |
1 |
|
Import Excel sheet |
1 (lowest) |
When no explicit priority is set, the job is processed as low-priority work.
How prioritization works
A target refers to units of work in a job that can be executed in parallel (for example, one file in a download order or one file-task combination in a rendition job). A flow defines how a target is processed, specifying tasks, execution order, parameters, and resulting outputs or renditions. Flow are assigned a priority.
Prioritization works at two levels:
-
The job priority gives the work its starting value.
-
The flow priority adds a boost for the target.
And, the file type and media-matrix matching rules determine which flows are applied to a target.
The media processing queue uses the final target priority to decide which waiting work will run next.
How target priority is calculated
The following formula is used to calculate the target priority:
target priority = job priority + average flow boost
The flow boost is determined by the selected media matrix priority. To set a priority, on the Media processing page, in the left pane, click a media processing set (for example, Content). In the right pane next to a specific flow, such as Images, click Settings
and, in the Flow settings dialog, from the Priority drop-down list, select a priority.
|
Media matrix priority |
Media matrix property |
Flow boost |
|---|---|---|
|
High |
0 to 62 |
3 |
|
Normal |
63 to 249 |
2 |
|
Low |
250 to 560 |
1 |
|
Background |
561 to 999 |
0 |
Use higher priorities only for file types or processing paths that need faster turnaround. Keep expensive, bulk, or background processing on lower priority flows so they do not compete with interactive work.
Values outside the 0 to 999 range are clipped to that range before mapping is applied.
If more than one flow matches the same file, the boost values are averaged before they are added to the job priority.
For more information, see Edit a conversion matrix and Conversion matrix structure.
Example
The following example illustrates how the final target priority is calculated:
-
A file upload job starts with priority 5.
-
The matching flow has a media matrix priority of 120.
-
A priority of 120 maps to a boost of 2.
-
Final target priority = 5 + 2 = 7.
Queue behavior
Priority affects queue order, not work that is already running. This means that:
-
A running target is not interrupted when a higher priority target arrives.
-
Waiting higher priority targets are selected before lower priority targets.
-
New work can move ahead of older work if its priority is higher.
Target buckets
Media processing groups target priorities into three buckets:
-
Low = 0 to 3
-
Medium = 4 to 7
-
High = 8 to 10
Each bucket is processed in parallel.
Common job patterns
Depending on the scenario, Content Hub might create one job with many targets or many jobs with one target. The following table contains common use case examples.
|
Use case |
1 job with N targets |
N jobs with 1 target |
|---|---|---|
|
Uploading assets through the user interface |
X | |
|
Process archive metadata |
X | |
|
Process archive subfiles |
X | |
|
Process download order |
X |
Special cases
Prioritization behaves differently in the following special cases.
Archives
Archives are processed in two stages:
-
The archive metadata is read first.
-
The files inside the archive are processed next.
Refresh renditions
Refresh rendition targets use the usual calculation, but the final priority is capped at 3 so that the work stays in the low-priority bucket.