Batch Queues
A JAMS Batch Queue provides the ability to control the number of Jobs allowed to start at any given time as well as the ability to distribute (load balance) Jobs across zero or more Agents.
Queues can be assigned to Jobs and Folders. They can be stopped and then started to temporarily pause execution of Jobs that have not already started. When a Queue is started, Jobs waiting for it to become available will be started in the order of their scheduling priorities.
Defining and using Queues in JAMS is optional.
Load Balancing
When multiple Agent names are assigned to a Queue, the Scheduler starts the next Job on the Agent with the fewest number of currently executing Jobs. JAMS Windows Outgoing Agents that do not have the Connect On Demand Agent property checked are automatically removed from the load balanced pool of servers when the Scheduler detects they are unavailable. The Agents are automatically returned to the pool of servers when they become available again.
Queues and Resources
While there are similarities between Batch Queues and Resources, there are some significant differences that are listed below.
- A Batch Queue is defined by the number of concurrent Job executions and/or different Agents that associated Jobs can be executed on.
- When you submit a Job, a Batch Queue can be adjusted but a Resource cannot.
- A Resource definition is based on the total number of unit quantities available. As these Jobs run, they consume the available units and they are released upon completion. Queues are defined by the maximum number of Jobs that they can run.
- Unlike Queues, Resource requirements can be subtracted on specific Jobs to allow them to run as exceptions, even if no quantity of a Resource is available.
- Unlike Queues, Resource requirements can be weighted to allow for throttling based on the different relative impact of Jobs on a system.
- Resource requirements can be defined at the Folder and the Job level. These values are then added together to define the total units required for the Job to begin executing.
- A Job can reference many different Resources, but only one Queue.
- Jobs will always count as 1 against the Queue Job limit, regardless of the Job type.
Batch Queues Screen
The Batch Queue screen lets you view all existing Queues, create new Queues, and modify existing Queues. Each Queue displays the following:
- Batch Queue Name – The name of Batch Queue.
- Started – A checkmark indicates the Batch Queue has started and any Jobs that are submitted to the Queue are available to run.
- Job Limit – The maximum number of jobs that will run concurrently.
- Description – An optional description of the Queue.
Viewing all Batch Queues
- Click Execution from the main menu.
- Click Batch Queues.
- Click a column heading to sort the list. The list can be sorted by only one column.
Creating a Batch Queue
- Click Execution from the main menu.
- Click Batch Queues.
- Click Add.
- In the Batch Queue Name field, enter a name for the Queue.
- In the Job Limit field, enter the maximum number of jobs allowed in the Queue.
- Click Save and Continue to Edit.
- Click the Status tab.
- Optional – In the Agent Name field, select an Agent for the Batch Queue.
- Click Save.
- Click the Security tab.
- Click ADD to add an Access Control Entry and allow users/groups to have access to the Batch Queue.
- Click Save.
Modifying Batch Queue Properties
You can modify the properties of the Queue as well as its status, the maximum number of Jobs it can run, and the Agent it runs on.
-
Click Execution from the main menu.
-
Click Batch Queues.
-
Click the Queue that you want to edit and select Properties.
-
Click the Summary tab to modify the following:
- Name
- Description.
-
Click the Status tab to modify the following:
- Under Status, select the checkbox to start or stop the Queue. If the checkbox is selected, Jobs submitted to the Queue are available to run.
- In the Job Limit field, enter the maximum number of Jobs that can run concurrently.
- In the Started On section, add, delete or modify the Agents that Jobs can run on. See the section below for details.
-
Click the Security tab to set the Access Control Entries and allow users/groups to have access to the Batch Queue.
-
Click Save.
Deleting a Batch Queue
- Click Execution from the main menu.
- Click Batch Queues.
- Click the Queue that you want to delete.
- Click Delete.
- When prompted to confirm the deletion, click Delete.
Agents in Batch Queues
Selecting an Agent in a Batch Queue is optional. If no Agent is specified in the Batch Queue and the Job Definition does not have/inherit an Agent, the Job executes locally on the Scheduler. If multiple Agent Names are specified, Jobs are distributed (load balanced) between the available Agent Names.
An Agent name in a Job definition overrides an Agent name in a Queue definition. However, the Job still runs on the assigned Queue and adheres to any Job Limit settings defined within the Queue.
Adding an Agent to a Batch Queue
You can add more than one Agent to a Batch Queue.
- Click Execution from the main menu.
- Click Batch Queues.
- Click a Batch Queue and click Properties.
- Click the Status tab.
- In the Agent Name column, select an Agent from the drop-down menu.
- Click Save.
Deleting an Agent from a Batch Queue
You can remove an Agent from a Batch Queue. This is useful when you deprecate an Agent server and Jobs assigned to this Queue should no longer run there.
- Click Execution from the main menu.
- Click Batch Queues.
- Click a Batch Queue and click Properties.
- Click the Status tab.
- In the Agent Name field, click under the Action column.
- Click Save.
Manually Starting or Stopping a Batch Queue
When a Job is waiting for a Queue Job limit slot, it cannot execute. You can manually start or stop a Queue to prevent or allow jobs to run. This is useful when you are performing some maintenance on agents that may cause jobs to not perform as expected.
- Click Execution from the main menu.
- Click Batch Queues.
- Click the Queue that you want to start or stop.
- Click Start or Stop. The Started column is updated.
Stopping or Starting a Batch Queue using PowerShell
If you are using a Queue rather than a Resource to create a maintenance window in JAMS, you can start or stop the Queue by creating a PowerShell Job.
- Click Jobs from the main menu.
- Select a Folder to save the Job.
- Click Add.
- In the Name field, enter a name for the Job.
- In the Execution Method field, select PowerShell.
- Click Ok.
- In the Source tab, enter the text below and replace “Q0001” with the name of the Queue.
$QueueName = "Q0001"
$JAMSDefaultServer = "localhost"
Stop-JAMSQueue $QueueName
#
Start-JAMSQueue $QueueName
- Click the Properties tab.
- In the Execute As field, select a Credential to run the Job.
- Click Save.
Batch Queue Tabs
| Summary Tab | Description |
|---|---|
| Batch Queue Name | This property is the name for the Batch Queue that is displayed in JAMS objects, such as Jobs or Agents. |
| Description | This property is an optional summary of the Batch Queue. |
| Last Change UTC | This property is the date and time the Batch Queue was added or changed. |
| Status Tab | Description |
|---|---|
| Start/Started | The Start/Started option lets you start or stop a Batch Queue from being used. |
| Job Limit | This property lets you set the maximum number of Jobs that will run concurrently. |
| Agent(s) | This section lets you add one or more Agents to the Batch Queue. |
| Last Change UTC | This property is the date and time the Batch Queue was added or changed. |
| Security Tab | Description |
|---|---|
| Security | The Security tab defines the level of access for this Batch Queue. This is an Access Control List with one-to-many Access Control Entries (ACE). You can add or delete an ACE. Each ACE can specify the following rights:
|
| Last Change UTC | This property is the date and time the Batch Queue was added or changed. |
| References Tab | Description |
|---|---|
| References | The References tab lets you view where the Batch Queue is used within JAMS. |