Workload Management

[info] Enterprise Edition only

For the Community Edition equivalent, see Queue Control.

The Workload Management (WLM) feature provides the capability to manage cluster resources and workloads.

This is accomplished through defining a queue with specific characteristics (such as memory limits, CPU priority, and queueing and runtime timeouts) and then defining rules that specify which query is assigned to which queue.

This capability is particularly important in Dremio clusters that are deployed in multi-tenant environments with a variety of workloads ranging from exploratory queries to scheduled reporting queries. In particular, WLM provides the following:

  • Provides workload isolation and predictability for users and groups.
  • Ease of configuration for SLA and workload management.
  • Predictable and efficient utilization of cluster resources.

Homogeneous Environment

Workload management works optimally in a homogeneous environment in terms of memory. That is, when each node in the Dremio cluster has the same amount of memory.

If you have a heterogeneous environment (nodes in a Dremio cluster have different amounts of memory), you should plan for the lowest common denominator (lowest amount of memory associated with a node).

How Workload Management Works

To access WLM, navigate to the following UI location:

Admin > Workload Management > Queues | Rules

You set up workload management by:

  1. Creating queues with different criteria depending on how you want to manage your jobs.
  2. Creating rules that do the following:
    • Establish conditions that target specific queries.
    • Assign queries that fit the conditions to specific queues.

The following diagram shows a basic WLM flow when a job query is submitted where Rule1 assigns job queries to Queue1, Rule2 to Queue2, Rule3 to Queue3, and so on. Rule4 indicates that any specified rule and/or all other queries can be rejected.

The Rule's conditions that a job query matches, determines which queue the job query is sent to.

Queues

Dremio allows you to define job queues, to which queries can be assigned, based on defined rules.

You can add new queues, edit existing queues, or removed queues.

  • If you add a new queue, you can customize the queue with the following configuration options.
  • If you edit an existing queue, all of the options are available for modification as when you add a new queue.
  • If you delete a queue, the Are you sure you want to remove this queue? popup message displays prior to you explicitly removing it.

Configuration Options

Category Option Description
Overview Name Name of the job queue.
CPU Priority Defines how much CPU time threads get respective to other threads. Changing this attribute only affects new or enqueued queries. Running queries continue using the previous setting until they complete.

Priority levels:

  • Critical
  • High
  • Medium (default)
  • Low
  • Background
Concurrency Limit Defines how many queries are allowed to run in parallel. Changing this attribute only affects new queries. For example, when the current limit is 5 and 10 long running queries have been submitted to the queue such that 5 of them are enqueued. If the user changes the setting to be unlimited, those 5 enqueued queries will remain enqueued until the running queries are done but new queries will start immediately.

Enabled by default; set to 10 queries.

Memory Management Queue memory Limit Defines the total memory that all queries running in parallel in a given queue can use per executor. Changing this attribute is effective immediately and may cause some queries to fail if the new value is smaller.

Disabled by default.

Job memory Limit Sets a limit on the memory usage at the query level. Changing this attribute only affects enqueued and new queries but not the currently running queries.

Disabled by default.

Time Limits Enqueued Time Limit Defines how long a query can wait in the queue before starting without being cancelled. Changing the setting only affects new queries. Enqueued queries are not affected.

Enabled by default; set to 5 minutes

Query Runtime Limit Defines how long a query can run before being cancelled. Changing the setting affects enqueued and new queries but won’t affect queries that are already running.

Disabled by default.

Default Queues

Dremio provides the following generic queues as a starting point for customization:

Rule Name Description
UI Previews CPU priority: High
Concurrency limit: 50
Low Cost User Queries CPU priority: Medium
Concurrency limit: 25
High Cost User Queries CPU priority: Medium
Concurrency limit: 5
Low Cost Reflections CPU priority: Low
Concurrency limit: 25
High Cost Reflections CPU priority: Low
Concurrency limit: 1

Queue and Job Limits

If you set up concurrency limits, ensure that you allocated job limits accordingly. For example, if you allow multiple concurrent jobs and if the total limit for each job is higher than the queue limit, then a job may fail if memory is consumed by other concurrent jobs.

Rules

Rules allow you to specify conditions that the scheduling module utilizes to either assign the query to a queue or reject the query. Rules are applied in order and are used to target queries to a specific queue or to reject queries. The first rule that a query matches determines the action taken.

You can create custom rules, use the provided rule templates, or modify the provided rule templates.

[WARNING] Dremio implementation of using rules for queue assignment may change in the future.

Conditions Used in Rules

The following conditions, as well as Dremio SQL functions, can be used in combination when creating rules to target specific jobs.

  • users
  • group membership (members)
  • query type
  • query cost - to find the cost of a query, navigate to:
    Job Profile > Resource Allocation > Query Cost
  • Other functions that are supported in sql: such as date/time

Query Types

Query Type Description
JDBC Jobs submitted from JDBC.
ODBC Jobs submitted from ODBC.
REST Jobs submitted from REST.
Reflections Reflection creation and maintenance jobs.
UI Run Full query runs in the UI.
UI Preview Preview queries in the UI.
UI Download Download queries in the UI.
Internal Preview Dataset formatting previews. Reflection recommender analysis queries.
Internal Run Node activity query. Data curation histogram and transformation suggestion queries.

Rule Examples

User Example

USER in ('JRyan','PDirk','CPhillips')

Group Membership Example

is_member('MarketingOps') OR is_member('Engineering')

Available Job Types Example

query_type() IN ('JDBC', 'ODBC', 'UI Run')

Query Plan Cost Example

query_cost() > 1000000

Combined Conditions Example
The following example includes targeting a job by a combination of user, group membership, query type, query cost, and time of day.

(
  USER IN ('JRyan', 'PDirk', 'CPhillips')
  OR  is_member('superadmins')
)
AND query_type IN ( 'ODBC')
AND query_cost > 3000000
AND EXTRACT(HOUR FROM CURRENT_TIME)
  BETWEEN 9 AND 18

Default Rules

Dremio provides the following generic rules as a starting point for customization.

Order Rule Name Available Query Types Rule Queue Name
1 UI Previews UI Preview query_type() = 'UI Preview' UI Previews
2 Low Cost User Queries JDBC, ODBC, REST, UI Run, UI Download, Internal Preview, Internal Run query_cost() < 30000000 Low Cost User Queries
3 High Cost User Queries JDBC, ODBC, REST, UI Run, UI Download, Internal Preview, Internal Run query_cost() >= 30000000 High Cost User Queries
4 Low Cost Reflections Reflections query_type() = 'Reflections' AND query_cost() < 30000000 Low Cost Reflections
5 High Cost Reflections Reflections query_type() = 'Reflections' AND query_cost() >= 30000000 High Cost Reflections
6 All Other Queries Reject

[info] The default setup covers all query types.

When setting your own custom rules, ensure that all query types are taken into account. Otherwise, you may experience unexpected behavior when using Dremio.


results matching ""

    No results matching ""