LATEST VERSION: 3.3.1 - CHANGELOG
Pivotal Greenplum Command Center v3.3.1

Workload Management

The System>Workload Mgmt screen allows users with Admin or Operator permission to view Greenplum Workload Manager rules. Users with Admin permission can add, edit, or delete rules.

The System>Workload Mgmt screen is present if, when you sign in, Greenplum Command Center detects that Workload Manager is running on the Greenplum Database master host. If the page is not available, make sure that Workload Manager is running and then sign out of Greenplum Command Center and sign in again.

Rules Tab

On the Rules tab you can see the Workload Manager rules. If you have Admin permission, you can also manage rules. Any changes you save to the rules are immediately active in Workload Manager.

Viewing Rules

Choose Admin>Workload Mgmt to display the currently active Workload Manager rules.

The current set of rules is displayed, one row per rule.

GP-WLM rules

The top line of a rule entry is the name of the rule, a symbolic label used to reference the rule. The name must be unique.

The second line of the rule display shows the following information:

  • the rule’s action and its argument, if any
  • the rule’s when clause, a Boolean expression that determines when the rule is matched
  • the rules’ optional including clause, a list of metrics to include in the context

Actions

The rule action describes the action that Workload Manager performs when the rule is matched. There are four actions:

  • Record - Records a message in the gp_wlm_records table, along with metrics from the Greenplum Database session or query that matched the rule. The text of the message the rule records is shown between “Record” and the when keyword. One row is added to the gp_wlm_records table when the rule is matched and another row when the rule stops matching. This action corresponds to the Workload Manager gpdb_record action.
  • Cancel query - Cancels the query that matches the criteria specified by the when clause. When a query matches this rule on any host or segment, Workload Manager calls the PostgreSQL pg_cancel_backend() function, which cancels the query. The event is logged in the gp_wlm_events table. This action corresponds to the Workload Manager pg_cancel_backend action.
  • Terminate session - Terminates the user session that matches the criteria specified by the when clause. When a query matches this rule, Workload Manager calls the PostgreSQL pg_terminate_backend() function, which ends the client’s session. The event is logged in the gp_wlm_events table. This action corresponds to the Workload Manager pg_terminate_backend action.
  • Throttle CPU - Holds a query to a maximum share of CPU on a host, specified as a percentage of CPU utilization between 0 and 100. When a query first matches this rule on any host, Workload Manager begins to throttle the amount of CPU consumed by all of the query’s processes running on that host to the specified percentage. Workload Manager writes a START record in the gp_wlm_events table when the rule is matched. When the rule no longer matches, Workload Manager stops throttling and writes an END record in the gp_wlm_events table.

When clause

The when clause is a Boolean expression that selects Greenplum Database query processes. The Boolean expression allows comparing numeric- and string-valued metrics with constant values using standard operators such as <, >, and =. String-valued metrics can be matched using regular expressions. Comparisons can be joined with AND and OR operators and parentheses can be used to force the order in which they evaluate.

When Workload Mangager matches a when expression to a query process the rule’s action is applied.

Including clause

The including clause is a comma-separated list of metrics that are to be added to the rule’s context. Use this clause to capture metrics that are not used in the when clause of the rule. The include metrics are saved in the context column of the gp_wlm_records or gp_wlm_events table when the rule is matched. Omit the scope portion of the metric in the including clause; Workload Manager determines the scope from the metric name.

Editing a Rule

  1. Click anywhere in a rule to edit the rule. The rule’s action (and argument, if any) and the when clause are presented for editing. Rule editing

    • Choosing a new action from the Action list changes the argument field to the type required by the new action or removes the field for actions with no argument.
    • While editing text in the when field, you can choose metrics and operators from a pop-up list, filtered to match initial characters you type.
  2. Click Save to save your changes or Cancel to abandon your changes.

Workload Manager validates the rule before it is accepted. If there are any errors, a message is displayed and the editing mode remains active.

Creating a New Rule

  1. Click Create New Rule to add a new rule. An empty rule editing form is displayed. Empty rule
  2. Enter a unique rule name in the Rule name field.
  3. Complete the form as described in Editing a Rule.
  4. Click Save to save the new rule or Cancel to abandon the rule.

Workload Manager validates the rule before it is accepted. If there are any errors, a message is displayed and the editing mode remains active.

Duplicating a Rule

Duplicating a rule is useful if you want to create a new rule similar to an existing rule. You can also duplicate a rule if you want to change the rule’s name, since editing an active rule’s name is not allowed. Just duplicate the rule, give the copy a new name and save it, and then delete the old rule.

  1. Click Duplicate to the right of the rule you want to copy. The rule is displayed in a rule editing form.
  2. Change the rule name to a new unique name.
  3. Edit the rule as described in Editing a Rule.
  4. Click Save to save the new rule or Cancel to abandon the rule.

Workload Manager validates the rule before it is accepted. If there are any errors, a message is displayed and the editing mode remains active.

Deleting a Rule

  1. Click Delete to the right of the rule you want to delete. A Confirm rule removal dialog box is displayed.
  2. Click Delete rule to delete the rule or Cancel to keep the rule.

Reference Tab

The Reference tab is a quick reference that illustrates the anatomy of a Workload Manager rule, describes syntax for the parts of a rule, and provides examples of rules. The quick reference includes links to more detailed information in the latest Greenplum Workload Manager documentation.

Reference