Manage job queue

When a job is submitted, the batch job manager (CMNGJOB) is in command and controls the execution.

CMNGJOB tries to start the submitted jobs. To control this process one or several job queues are supplied for execution of the jobs. Each queue has a maximum limit for the number of jobs that are allowed for parallel execution, to avoid overloading the batch processor. This is set in 'Job Queue. Open' (MNS300).

The queue is determined by the job control record in CJBCMD. Jobs without a specific queue assignment are placed in the default queue QBATCH.

The submitted jobs are executed in order of priority. First, all jobs with priority 1 are executed, then all jobs with priority 2, and so on.

Example:

Queue A has 100 jobs with priority 1 and 70 jobs with priority 2. Queue B has 50 jobs with priority 1.

The execution order will be:

  1. Queue A, priority 1 (100 jobs)
  2. Queue B, priority 1 (50 jobs)
  3. Queue A, priority 2 (70 jobs)

Job queues and subsystems for different job types

It is a good idea to create separate queues for different types of jobs, that is, a special queue for jobs with long execution time, another for medium and yet another for quick running jobs. Specific queues can also be assigned for a given group of jobs. Different queues combined with an appropriate limit for maximum number of jobs can be a powerful, albeit simple, way to improve system utilization and availability.

Maximum number of jobs per subsystem

How many jobs that actually can be started are controlled by a maximum jobs setting for each subsystem. These settings are defined in the M3.properties file and M3 Script file.

Note: 

This setting is not used anymore and must be set to zero.

boot.subs.maxjobs=0

Settings are instead made in M3 Script file

Example

If 20 jobs are allowed in SUB:B subsystem and three job queues with a maximum of 8,3 and 1 parallel jobs are attached to that subsystem, the load on the subsystem will be a maximum of 8 +3 +1 = 12 jobs.

If 10 jobs are allowed in SUB:B subsystem and three job queues with a maximum of 8,3 and 1 parallel jobs are attached to that subsystem, the load on the subsystem will be a maximum of 8 +3 +1 = 12 jobs. That is 2 more than allowed. Here load balancing between M3 Subsystems can be used, depending on the settings in the M3.properties file.

Preparing a job to be placed in a job queue

Follow these steps to prepare a job to be placed in a job queue (in a file) instead of being sent directly to run in batch.

You have to set up and started jobs in the subsystem. For further information, refer to M3 Business Engine Auto Start Job Descriptions.

Define a job queue

  1. Start 'Job Queue. Open' (MNS300). Specify an ID for the job queue.
  2. Open the E panel. Fill in Max active jobs running at the same time in this job queue.

    Press Next.

Place a job in job queue

Start 'Job. Connect Job Queue' (MNS310). Specify a job in the 'Job' field. The 'User/group' field indicates the control of the start of the database job. A blank user indicates all users.

  1. Open the E panel. Select the job queue in which this job should be placed. Select a priority for the job.

    Select if you want the user to confirm job start or not and the type of confirmation to be used. Select if the job history should be saved in the job history file. The saved jobs are displayed in (MNS320). Click Next.

Related topics