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 a workspace, which are reported on the Workspaces page. Or, the criteria can be based simply on the repository to which a workspace belongs.
- 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.
- Queues: The FME Server mechanism that holds jobs and routes them to engines based on job routing and engine assignment rules.
Example
Consider that you want to offload your highest-processing jobs to FME Engines that are installed on a separate server, named "FMEServer2". 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_FMEServer2, that will hold the jobs that are routed to the engines on FMEServer2.
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_FMEServer2. (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_FMEServer2. 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 FMEServer2. 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 FMEServer2. This way, if you add more engines to FMEServer2, 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.
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.
1. Queues Tab: Create a Queue
- On the Queues tab, click New.
- Enter a Name and Description (optional) for the queue.
- Assign a Priority (defaults to 5). Priority must be an integer between 1 and 10. The highest priority is 1 and the lowest priority is 10. 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 New.
- On the Create Job Routing Rule page, specify the following:
- A Name for the rule.
- Type:
- Metric: The queue handles jobs that meet the requirements of specified job performance measures, including one or more of the following:
- % 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.
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, for a combination of Average % CPU > 80 and Average CPU Time > 1 hour, specify % CPU > 80 % AND CPU Time > 1 Hour.
- Repository: The queue handles jobs in one ore more specified repositories.
- Repositories: Specify one or more repositories to apply to the queue.
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.
- Metric: The queue handles jobs that meet the requirements of specified job performance measures, including one or more of the following:
- 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 New.
- On the Create Engine Assignment Rule page, specify:
- A Name for the rule.
- Type:
- Property: Engines are assigned to queues based on properties of engines and queues.
- Rule: Using boolean logic, specify the properties that determine how engines are assigned to the specified queue(s).
- Dynamic: FME Engines license type is Dynamic.
- Standard: FME Engines license type is Standard.
- Custom: In addition to Dynamic and Standard, you can specify other engine properties as they appear on the Engines tab, such as the name or operating system of the host machine.
- Physical Memory of Engine Host: Amount of RAM on the machine hosting an FME Engine.
- Processor Count of Engine Host: Calculated as: (number of CPUs) x (number of Cores) x (number of hyperthreads) on the machine hosting an FME Engine.
- Number of queued jobs: The number of jobs that are currently in a specified queue.
- Longest queued job wait time: The time of the job that has been waiting the longest in a specified queue.
- Time for all queued jobs to finish: The time for all jobs in a specified queue to finish based on historical data.
- CPU for all queued jobs to finish: The CPU time for all jobs in a specified queue to finish based on historical data.
You can specify one or more of the following properties:
Expand for propertiesThe Rule drop-down is prepopulated with some properties from which to select. To add more properties to the drop-down, click Create Property. Beside Type, specify a property category, either Custom, Engine, or Queue. If Custom is specified, enter a Property exactly as it appears on the Engines tab. If Queue is specified, select a queue Property, and specify a queue to which the property should apply. If Engine is specified, select an engine host Property.
Note: For Kubernetes deployments of FME Engines, specify Custom and the name property of the applicable engine deployment. For more information, see Defining FME Engines and Queue Control Properties to a Kubernetes Deployment.
The rule appears beneath the Rule drop-down as you select properties. To add rules, click + Rule. To nest properties in the rule, click + Ruleset.
For example, to specify any dynamic engine on server WHISTLER (a Custom property), specify Dynamic AND WHISTLER.
- Name: Engines are assigned to queues by engine name.
Note: For containerized deployments of FME Server, such as Kubernetes, we strongly recommend specifying the engine name through the Property setting instead (see above).
- Engines: Specify the engine names you want to assign to the queue(s).
Note: You cannot specify any engines that are assigned to Streams.
- Property: Engines are assigned to queues based on properties of engines and queues.
- 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.
- Click OK.
Managing Queues and Rules
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.
Editing Queues and Rules
Open the Queues, Job Routing Rules, or Engine Assignment Rules tab, depending on what you want to edit. Click on a queue or 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 and Rules
Note: You cannot remove the Default queue.
Open the Queues, Job Routing Rules, or Engine Assignment Rules tab, depending on what you want to remove. Select one or more queues or rules, click Actions, and select Remove.