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:

  • boot.server.maxsubs=0

    Maximum number of subsystems that can be started by server (0 - no limit

  • boot.supervisor.balanceload

    Should load balancing between M3 Subsystems be used? Value 0= False, 1= True.

  • boot.subs.maxjobs

    How many jobs can be started in a M3 Subsystem at the same time? This property may be used to load balance between different subsystems running in different M3 servers. Value 0= No limit

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.

Job queue status

Job queue status controls the execution of jobs in a specific queue. The status dictates if the job in a specific queue is processed or ignored. This can be particularly useful if there are prioritization of job queues at a certain time.

These statuses are available for job queues:
  • 20 - Active. Jobs with active job queues run normally. By default, all job queues are set in Active status.
  • 90 - Deactivated. Jobs with deactivated job queues still receive jobs but do not process records. Jobs remain in 00 - 'Not Started' status in 'Job. Display History' (MNS320).

Changes in job queue status only take effect after five (5) minutes without restarting the batch job manager (CMNGJOB). If immediate effect is required, restart CMNGJOB in 'Subsystem Job. Open' (MNS051).

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.
  3. Specify the job queue status. Click 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 the job should be placed.
  2. Select a Priority for the job.
  3. Select Conf job start if you want the user to confirm job start and the type of confirmation to be used.
  4. Select the Save job hist check box if history should be saved in the job history file. The saved jobs are displayed in (MNS320). Click Next.