Prioritization Strategies for Class A Jobs

Being able to assign a priority, or "class" (A, B, or C), to a job and being able to reserve work processes for class A jobs presents a choice between two prioritization strategies for your background jobs:

  • Critical track (class A) and two-level priority (classes B and C): If you have mission-critical jobs whose immediate execution must always be ensured, you can set up class A as your "critical jobs" category. Reserve a work process for class A jobs and assign class A only to these mission-critical jobs. See the example below.

    Classes B and C provide secondary two-level job prioritization. Class B jobs get free background work processes before class C jobs. This secondary prioritization operates separately from the class A critical track, since class B and C jobs can never block a class A job.
  • Three-level priority for allocation of free work processes: You can also decide to run with a straight three-level priority scheme for allocating free work processes. In this case, reserve no work processes for class A. See the example below.

    This approach guarantees no open path for class A jobs, which might have to wait if all work processes are busy, even though the work processes may be running class B or C jobs. However, class A jobs that are waiting are guaranteed to start before class B and C jobs that are also waiting. Unlike the "critical track" strategy, no work processes are kept idle for class A jobs.

    If the class A workload is not high or there is rarely a bottleneck in background processing—at least one work process is usually free—there may be no advantage in reserving a work process for class A jobs. Such a reservation in this case might simply result in a work process rarely being used.

Process

Critical track (class A) and two-level priority (classes B and C)

Example 1. A server is set up with three work processes for background processing. The Class A field is set to 1, keeping one work process always open for class A jobs:

Background work process 1: Reserved for class A job
Background work process 2: Free for any job
Background work process 3: Free for any job

When a class A job arrives, it runs in one of the three free background work processes. One of the free background processes remains free, reserved for the time when another class A job arrives. One work process remains for jobs of classes B and C:

Background work process 1: Running class A job
Background work process 2: Reserved for class A job
Background work process 3: Free for any job

Example 2. All three background processes are free and four jobs become eligible to start: two class A jobs and one each of class B and class C. The two class A jobs start immediately, and the remaining background work process is reserved for the eventual arrival of another class A job. Neither the class B nor class C jobs can start until one class A job finishes.

Background work process 1: Running class A job
Background work process 2: Running class A job
Background work process 3: Reserved for class A job
Waiting for free work process: Class B job
Class C job

When one class A jobs finishes, the class B job can start, but the class C job continues to wait since the remaining work process is reserved for a new class A.

Background work process 1: Running class A job
Background work process 2: Running class B job
Background work process 3: Reserved for class A job
Waiting for free work process: Class C job

When the class B job finishes, the class C job can finally run:

Background work process 1: Running class C job
Background work process 2: Reserved for class A job
Background work process 3: Free for any job
Waiting for free work process: No jobs

Example

Three-level priority for allocation of free work processes

Example. A server is set up with three work processes for background processing, with none reserved for class A jobs.

If, when all three work processes are running background jobs, a job from each class becomes eligible to run, the class A job could not start because no work process is free. When one becomes free, the class A job would be the first to run:

Background work process 1: Running class x job
Background work process 2: Running class x job
Background work process 3: Running class x job
Waiting for free work process: Class A job
Class B job
Class C job

When one of the running jobs finishes:

Background work process 1: Running class x job
Background work process 2: Running class A job
Background work process 3: Running class x job
Waiting for free work process: Class B job
Class C job

When another class A job becomes eligible to start, it also must wait, because all background work processes are busy. When a work process becomes free, the class A job starts ahead of the class B and C jobs, even if these have been waiting longer.

No comments:

topics