Setting Up Queues

Overview

This chapter explains how to set up queues so that your jobs run efficiently on your network. Jobs enter queues when their dependencies are met and are released from a queue by the master. In the previous chapters, the jobs you created ran from the default queues.

Queues are most effective when more jobs are scheduled than you have resources to handle them. Each queue has a job limit and a priority that helps to determine from which queue jobs are launched. When a queue’s limit is reached, Enteprise Scheduler selects the next queue to run jobs on according to queue priorities. Within a queue, a job’s individual priority determines which job in the queue is launched first.

Queues are defined in a hierarchy, with the System Queue at the top.

To view Enteprise Scheduler’s predefined job queues, select Scheduling>Queues in the Navigator pane.

Figure 12-1 Queues Pane

 

 

Each queue contains a set of queue filters. Queue filters are designed to accept or reject jobs based on their properties.

Besides prioritizing the execution of large quantities of jobs, queues can be used for a number of other purposes:

  • To limit the number of jobs of a particular type or group running concurrently
  • To control the flow of jobs executed, overall or by an individual queue, so that system resources are used more evenly and peak demands are reduced
  • To single-thread jobs requiring a particular resource, such as exclusive access to a database
  • To restrict the hours when jobs run to a time window defined by the queue, for example, to allow batch processing to occur overnight
  • To launch jobs immediately for special cases where it is required

This chapter covers:

  • Setting up the Inventory Weekly job group
  • Creating three jobs for the Inventory Weekly job group
  • Setting up a queue
  • Adding the Inventory Weekly job group to production
  • Monitoring the job group in production
  • Changing the queue limit
  • Re-submitting the Inventory Weekly job group

Note To complete the exercises in this tutorial, you need to:

  • Install Enteprise Scheduler in the default directory Scheduler (or the examples in this tutorial will not work properly)
  • Select the Super User option in your User definition
  • Configure a default agent
  • Create and have available the work day calendar


 

Setting Up the Inventory Weekly Job Group

In this example, we will design a queue to accept jobs of a particular job group. Otherwise, there will be no job group to choose from when the queue is created.

To set up the Inventory Weekly job group:

1. From the Navigator pane, select Definitions>Jobs to display the Jobs pane.

2. Right-click in the Jobs pane and select Add Job Group from the context menu.

 

3. In the Job Group Name field, enter Inventory Weekly . Make sure the Parent Group field is empty.

4. Click the Schedule tab, if not selected.

5. In the Calendar list, select the work day calendar.

6. Click the Options tab.

7. Select the Require operator release option.

8. Click OK .

9. Click Cancel at the Effective Date dialog. (The job group should not enter the schedule yet.)

Creating Jobs for the Inventory Weekly Job Group

Now, we will create three jobs ( Inventory_10 , Inventory_11 and Inventory_12 ) that belong to the Inventory Weekly job group, with no dependencies.

To create jobs for the Inventory Weekly job group:

1. In the Jobs pane, select the Inventory Weekly job group .

2. Click the Add Job button or right-click and select Add Job from the context menu to display the Job Definition dialog.

3. In the Job Name field, enter Inventory_10 .

4. Verify that Inventory Weekly is displayed in the Parent Group list. If not, select it.

5. In the Command field, enter the full path to the Inv10 batch file.

6. Click the Notes tab. We will use the Notes tab to enter a short description of the job.

The Notes tab is a good place to add special instructions or explanatory comments without affecting the job’s execution.

7. In the Other Notes field, enter Inventory Processing Program .

8. Click OK .

9. Click Cancel at the Effective Date dialog.

Duplicating a Job Definition

To duplicate a job definition:

1. Select the Inventory_10 job in the Jobs pane if not already selected, then right-click and select Copy Job/Group from the context menu.

A job displays in the Jobs pane named Copy of Inventory_10 .

2. Double-click Copy of Inventory_10 and rename it to Inventory_11 .

3. In the Command field, change Inv10.bat to Inv11.bat .

4. Click OK .

5. Click Cancel to prevent the job from being scheduled.

6. Repeat the steps above to create a third job called Inventory 12 and enter the full path to the Inv12.bat file in the Command field.

Setting Up a Queue

We will set up a queue named Inv_Weekly and give it a queue limit of three. The jobs in the Inventory Weekly group will run in this queue. The queue configuration parameters will single-thread (run one at a time) the jobs in the group.

To set up a queue:

1. From the Navigator pane, select Scheduing>Queues to display the Queues pane.

2. Right-click the System Queue and select Add Queue from the context menu to display the Queue Definition dialog.

Figure 12-2 Queue Definition Dialog

 

3. In the Queue Name field, enter the name Inv_Weekly .

4. Leave System Queue in the Parent field.

We defined Inv_Weekly as a direct sub-queue of the system queue in the queue hierarchy. This means there are no intermediate queues to impose their own restrictions and affect job execution.

5. Change the Limit value to 3 . This allows a maximum of three jobs from this queue to run concurrently.

6. Change the Priority value to 60 .

Default queues have a priority setting of 50 . Since default queues can accept the jobs that you created, this higher priority value will ensure that the jobs enter this queue. When the queue manager sees two or more queues that can accept a job, it always assigns the job to the queue with the highest priority.

7. On the Filters tab, click the Add button to display a list and select Job Group .

The Queue Filter Condition dialog displays.

8. Select the Inventory Weekly job group.

9. Click OK . The filter is entered into the Filters tab.

 

The Always option in the Hours Available section should be selected by default. This means that the Inv_Weekly queue can run at any time. If you de-select the Always option, you can restrict the queue to operate within a specific time window. Jobs assigned to the queue would then run only if the current time were within that time window.

10. Click OK . Inv_Weekly is added to the list of queues on your system.

Adding the Inventory Weekly Job Group to Production

Now, submit the group Inventory Weekly into the production schedule.

To submit the group into the production schedule:

1. In the Jobs pane, right-click the Inventory Weekly job group and select Insert into Schedule from the context menu.

2. Click OK in the Insert Job Into Schedule dialog.

3. Click OK in the Information dialog.

Monitoring the Job Group in Production

To monitor the job group in production:

1. From the Navigator pane, select Operations>Job Activity to display the Job Activity pane.

Your job group is listed in bold showing the Waiting On Operator status.

2. Right-click the Inventory Weekly job group and from the Job Control submenu select Release/Resume to start the job group.

3. Click Yes in the Confirm dialog.

4. Click OK in the Information dialog.

 

The Inventory Weekly job group goes active, along with the three jobs: Inventory_10 , Inventory_11 , and Inventory_12 . Because the limit on the Inv_ Weekly queue is set to 3 , all three jobs in the group Inventory Weekly are launched at once, and now run to completion.

5. Scroll to the right in the Jobs pane to view the Queue column.

Note that the Inventory_10 , Inventory_11 and Inventory_12 jobs are running from the Inv_Weekly queue.

Changing the Queue Limit

Changing the queue limit from any number to 1 changes the queue from multiple to single-threaded processing.

To change the queue limit:

1. From the Navigator pane, select Definitions>Queues to display the Queues pane.

2. Double-click the Inv_Weekly queue to display its definition dialog.

3. Lower the Limit from 3 to 1 .

4. Click OK to save the changes.

The limit change is displayed in the Queues pane.

Re-submitting the Inventory Weekly Job Group

Now we re-submit the Inventory Weekly job group into the production schedule.

To re-submit the job group:

1. From the Navigator pane, select Definitions>Jobs to display the Jobs pane.

2. Right-click the Inventory Weekly job and from the context menu select Insert Job into Schedule .

3. Click OK in the Insert Job Into Schedule dialog.

4. Click OK in the Information dialog.

5. From the Navigator pane, select Operations>Job Activity to display the Job Activity pane.

You can now see another occurrence of your job group and its jobs in the Job Activity pane.

6. Click the new occurrence of the Inventory Weekly job group.

7. Right-click the occurrence of the Inventory Weekly and select Job Control from the context menu.

8. Select the Release/Resume option.

9. Click Yes in the Confirm dialog.

10. Click OK in the Information dialog.

The Inventory Weekly job group goes active, and the jobs within the group run again in no particular order. This time, however, they run one at a time because their assigned Inv_Weekly queue has a limit of 1 . While they are running, if you insert or rerun any other job on the schedule that belongs to a different queue, it runs immediately since it does not belong to the Inv_Weekly queue and is not restricted by its limit.