Defining a Plan

After enabling the Resource Manager, you have to create one or more plans and later, one or more rules linked to one of these plans.

To define a plan do the following:

  1. Click the Plans tab.
  2. Click New to create a plan. In the “Create plan” dialog, enter the name of the plan and optionally, a description.
Resource Manager: creating a new plan

Resource Manager: creating a new plan

  1. Click New restriction. In this dialog, select two things:

    1. Execute when: select when the plan will be activated. The options are:

      1. Always.
      2. When the CPU usage goes over a certain percentage. This restriction is evaluated when the query starts and every 20 seconds.
    2. Select the actions the Resource Manager will perform when the condition above is met. These actions are applied to SELECT or CALL statements, not to DDL (CREATE VIEW, CREATE REST WEBSERVICE, etc.) or DML ones (INSERT, UPDATE, etc.)

      1. Stop query always. Stops the query immediately.

      2. Switch query to plan: the query will be moved to a different plan.

      3. Stop query when the maximum execution time has been reached.

      4. Stop query when the maximum number of returned rows has been reached.

      5. Set priority of the threads that execute the query: changes the priority of the threads spawned by the Virtual DataPort server to run the query. 1 is the lowest priority and 10, the highest.

        Increasing the priority of the threads makes the query run faster.

        Important

        If the Virtual DataPort server runs on Linux, this action will only be applied if the following two conditions are met, otherwise it will be ignored:

        • Virtual DataPort is started with the root user
        • And the following has been added to the “JVM options” of the Virtual DataPort server: -XX:ThreadPriorityPolicy=1.

        The reason for having to meet these conditions is that on Linux, only processes launched by the root user can change the priority of its threads dynamically.

        This reminder does not affect Virtual DataPort servers that run on Windows because on Windows, processes can change the priority of its threads.

      6. Set the maximum number of concurrent queries. Sets the maximum number of concurrent queries run by the group of users that meet the condition of a rule (rules are explained in the next section).

        For example, let us say that we create a rule with the condition “access_interface=JDBC” and assign to it a plan that limits the maximum number of concurrent queries to 30. If 35 JDBC clients execute a query at the same time and they do not meet the condition of another rule that is higher on the list of rules, the Server will only execute 30 queries concurrently. The other ones will be queued.

        The value of this action does not override the maximum number of concurrent queries set in the “Server Configuration” dialog.

      7. Set the maximum number of queued queries. Sets the maximum number of queued queries run by the group of users that meet the condition of a rule.

        The value of this action does not override the maximum number of queued queries set in the “Server Configuration” dialog.

      8. Enable/disable the automatic simplification of this query. The process of automatic simplification of queries is explained on the section Automatic Simplification of Queries.

    3. Click Ok to save the restriction and again, to save the plan.

You can create a plan with several restrictions. For example,

  • A restriction that is triggered when the CPU usage is above 50%.
  • A restriction that is triggered when the CPU usage is above 80%.