Queue Control
Select Engine Management > Queue Control, Job Routing Rules, or Engine Assignment Rules.
Queue control is a mechanism for targeting FME Engines to run specific jobs. The reasons for using queue control include:
- Controlling the priority of job requests.
- Sending a job to an FME Engine in close proximity to a data source.
- Reserving FME Engines for scheduled tasks.
- Reserving Dynamic Engines for specific jobs.
- Reserving some FME Engines for quick jobs, and others for high-load jobs.
- Sending a job to an FME Engine that supports a particular format.
How It Works
Queue control is configured through three mechanisms that work together to ensure the right engines run your jobs.
- Job Routing Rules: The criteria for a job to meet in order to qualify for a specific queue. Criteria can be based on performance metrics of workspaces, which are reported on the Workspaces page. Or, the criteria can be based on other properties of workspaces, such as name or repository.
- Engine Assignment Rules: The assignment of engines to queues based on properties of engines or queues. Alternatively, engines can be assigned to queues by engine name. Optionally, with Active Periods, engine assignment rules can apply only at specified times.
- Queues: The FME Flow mechanism that holds jobs and routes them to engines based on job routing and engine assignment rules.
Example: Routing Jobs from a Specified Repository
Expand for example
Consider that you want to run all workspaces in repository Samples on two specific FME Engines.
First, create a queue, named Samples_Queue, that will hold the jobs that are routed to the specified engines. Next, create a job routing rule that routes jobs from the Samples repository to Samples_Queue:
- Type: Repository,
- Repositories: Samples
- Queue: Samples_Queue
Finally, create an engine assignment rule that assigns engines to run jobs routed to Samples_Queue:
- Type: Name
- Engines: Select the two FME Engines that you want to assign to queue Samples_Queue.
- Queues: Samples_Queue
Expand for example
Consider that you want to offload your highest-processing jobs to FME Engines that are installed on a separate server, named "FMEFlow2". On the Workspaces page, inside individual repositories, you can see some useful performance statistics for workspaces that have run jobs to date, or since the statistics were updated. You decide to offload jobs to this server based on a combination of Average % CPU > 80 and Average CPU Time > 1 Hour.
First, you create a separate queue, named queue_FMEFlow2, that will hold the jobs that are routed to the engines on FMEFlow2.
Next, you create a job routing rule that specifies: 1) Your job routing criteria—in this case, %CPU > 80 % AND CPU Time > 1 Hour; and 2) Jobs that meet these criteria are assigned to queue_FMEFlow2. (Note that you can assign a job routing rule to only one queue. A queue, however, can be assigned to multiple job routing rules.)
Finally, you create an engine assignment rule that specifies which engines run jobs that are routed to queue_FMEFlow2. You can specify the engines by name. However, a better option is to specify the engines based on a common system property assigned to all the engines installed on server FMEFlow2. On the Engines tab, you can see that one of the system properties assigned to your FME Engines is the server name on which they are installed. In this case, some of your engines are assigned the property FMEFlow2. This way, if you add more engines to FMEFlow2, they can also run jobs in the queue without explicitly adding them to this rule. (Note that more than one queue can be assigned to an engine assignment rule.)
Things to Consider
When working with queue control, keep in mind the following:
- You can assign priorities to queues. Depending on timing, jobs that route to higher-priority queues may be submitted before those in lower-priority queues.
- A job routing rule can apply to only one queue. However, a queue can be assigned to multiple rules. If a job meets the criteria for more than one rule, the rules that takes precedence are listed in order on the Job Routing Rules tab. For more information, see Prioritizing Job Routing Rules (below).
- When a job is submitted, it may qualify for more than one queue. However, if that same job is resubmitted, it is assigned the same queue from which it ran previously.
- Jobs that do not route to any user-defined queues route to the Default queue.
-
For a metric-based job routing rule to take effect, the workspace must have run enough times since statistics are initially collected or reset to generate a statistically significant sample. The required minimum number of jobs to run for a significant sample may vary between 30 to 100, depending on variability of data and the degree of precision required by the rule (for example, minutes versus seconds). The more variable the input data, and the higher degree of precision that is required of this data, the larger the sample size that is required. If a job routing rule does not reference a statistically significant sample of jobs run, the next applicable rule takes effect, by priority, or the job routes to the Default queue.
- Explicitly defining a queue, such as on the Run Workspace page, a Run a Workspace action, in Schedules, or through Job Directives, effectively bypasses job routing rules.
- You can view the queues to which your FME Engines are assigned on the Engines tab. Additionally, to assist in balancing engine load, you can set a limit on the number of queues to which engines can be assigned.
Getting Started with Queue Control
To get started with queue control, create your own queues, specify the job routing rules that apply to each queue, and assign engines to run queued jobs.
Expand for instructions
1. Queues Tab: Create a Queue
- On the Queues tab, click Create.
- Enter a Name and Description (optional) for the queue.
- Assign a Priority. The highest priority is 10 and the lowest priority is 1. Queues with higher priority submit job requests before queues with lower priority, depending on timing.
- Click OK.
2. Job Routing Rules Tab: Assign the Queue to a Rule
To assign a queue to an existing rule:
- Open the Job Routing Rules tab and click on a rule to open it.
- In the Queue field, update the queue to which this rule applies.
- Click OK.
Note You can assign a rule to only one queue.
To assign a queue to a new rule:
- Open the Job Routing Rules tab and click Create.
- On the Create Job Routing Rule page, specify the following:
- A Name for the rule.
- Type:
- Properties: The queue handles jobs that meet the requirements of specified job performance measures or other properties, including one or more of the following:
Expand for properties- % CPU: Jobs whose Average % CPU meets the requirements specified in the rule.
- CPU Time: Jobs whose Average CPU Time meets the requirements specified in the rule.
- Elapsed Time: Jobs whose Average Elapsed Time meets the requirements specified in the rule.
- Peak Memory Usage: Jobs whose Average Peak Memory Usage meets the requirements specified in the rule.
- Repository: Jobs that originate from workspaces in one or more specified Repositories.
- Workspace: Jobs from one or more specified workspaces. Specify the repository, then the workspace.
- Source Type: Jobs that originate from one or more specified FME Flow mechanisms.
- Source Name: Jobs that originate from one or more named FME Flow items, such as the name of a schedule.
- User Name: Jobs that run under the specified Username. For more information about the Username property, see Jobs (Completed, Queued, or Running).
- User Role: Jobs that run under any Username belonging to one or more specified Roles. For more information about the Username property, see Jobs (Completed, Queued, or Running).
Using boolean logic, specify the parameters of the Rule. To add parameters to the rule, click + Rule. To nest parameters in the rule, click + Ruleset.
For example, to combine Average % CPU > 80 and Average CPU Time > 1 hour, specify % CPU > 80 % AND CPU Time > 1 Hour.
Note
For a metric-based job routing rule to take effect, the workspace must have run enough times since statistics are initially collected or reset to generate a statistically significant sample. The required minimum number of jobs to run for a significant sample may vary between 30 to 100, depending on variability of data and the degree of precision required by the rule (for example, minutes versus seconds). The more variable the input data, and the higher degree of precision that is required of this data, the larger the sample size that is required. If a job routing rule does not reference a statistically significant sample of jobs run, the next applicable rule takes effect, by priority, or the job routes to the Default queue.
- Repository: The queue handles jobs that originate from workspaces in one or more specified Repositories.
Note To combine repository with other criteria, specify Type: Properties, Rule: Repository, specify a repository, then add additional Properties.
- Queue: Apply this rule to a queue.
- Enabled: By default, the rule is enabled, which means that subsequent jobs that meet the requirements of the rule are routed to the specified Queue. If disabled, jobs that would otherwise route to this queue based on this rule instead route to the next applicable rule, by priority (see Prioritizing Job Routing Rules, below). If no other rules apply, jobs route to the Default queue.
- Click OK.
3. Engine Assignment Rules Tab: Specify How Engines are Assigned to Queues
A set of engine assignment rules determines how engines are assigned to queues. You can assign queues to specific engines by name, or based on the properties of engines and queues.
To add a queue to an existing engine assignment rule:
- Open the Engine Assignment Rules tab.
- Click the rule to which you want to add the queue.
- On the Editing Engine Assignment Rule page, add the queue to the Queues field.
- Click OK.
To add a queue to a new rule
- Open the Engine Assignment Rules tab, and click Create.
- On the Create Engine Assignment Rule page, specify:
- A Name for the rule.
- Type:
- Queues: Specify one or more queues to route jobs to engines specified in this rule.
- Enabled: By default, the rule is enabled. If disabled, jobs that would otherwise route to engines based on this rule instead route to the Default queue.
- Active Periods: Specify the Active Periods during which the engine assignment rule applies. If None, the rule always applies.
- Click OK.
Managing Queues and Rules
Viewing and Resetting Queue Statistics
FME Flow keeps track of statistics on completed jobs for each queue. On the Queues tab, select a queue of interest. In the right pane, click Stats. Statistics values are cumulative until explicitly reset. To reset, click Reset Statistics.
Warning Reset Statistics affects all queues.
Prioritizing Job Routing Rules
A rule can apply to only one queue. However, a queue can be assigned to multiple rules. If a job meets the criteria for more than one rule, the rules that takes precedence are listed in order on the Job Routing Rules tab. To change the priority of a rule, click the Priority icon beside the rule, and select Move Up or Move Down.
Updating the Priorities of Multiple Queues
On the Queues tab, click Edit Priorities. Move the cursor over the Priority field for the queue you want to configure. Use the up/down arrows to change the priority as desired. Click Save.
Limiting the Number of Queues to which Engines can Be Assigned.
You can view the queues to which your FME Engines are assigned on the Engines tab. You may find that some engines bear a heavier queue load than others based on the current configuration of your engine assignment rules. To redistribute this load, you can set a limit on the number of queues to which engines can be assigned.
From the Engine Assignment Rules tab, click Set Limit. On the Queue Limit Per Engine dialog, move the Unlimited Queues slider to the left, specify the Maximum Queues per Engine, and click OK.
Editing Queues
Open the Queues tab and click on the queue you want to edit. In the right pane, click the edit icon (at top right).
Editing Rules
Open the Job Routing Rules, or Engine Assignment Rules tab, depending on what you want to edit. Click on a rule to edit it.
Enabling and Disabling Rules
Open the Job Routing Rules or Engine Assignment Rules tab, depending on what you want to edit. Select one or more rules, click Actions, and select Enable or Disable.
When a job routing rule is disabled, jobs that would otherwise route to a queue based on the rule instead route to the next applicable rule, by priority (see Prioritizing Job Routing Rules, above). If no other rules apply, jobs route to the Default queue.
When an engine assignment rule is disabled, jobs that would otherwise route to engines based on this rule instead route to the Default queue.
Removing Queues
Note You cannot remove the Default queue.
Open the Queues tab. Select the queue you want to remove. Remove. In the right pane, click the remove icon (at top right).
Removing Rules
Open the Job Routing Rules,or Engine Assignment Rules tab, depending on what you want to remove. Select one or more or rules, click Actions, and select Remove.