Change MEDIUM Service Concurrency Limit (ECPU Compute Model)

If your application requires customized concurrency, you can modify the concurrency limit for your Autonomous AI Database MEDIUM service.

Picking one of the predefined services provides concurrency values that work well for most applications. In cases where selecting one of the default services does not meet your application’s performance needs, you can use the MEDIUM service and modify the concurrency limit. For example, when you run single-user benchmarks, you can set the concurrency limit of the MEDIUM service to 1 in order to obtain the highest degree of parallelism (DOP).

Note: Changing the concurrency limit is only allowed for an instance that has four (4) or more ECPUs.

For example, with Compute auto scaling disabled, if your instance is configured with 400 ECPUs, by default Autonomous AI Database provides a concurrency limit of 100 for the MEDIUM service:

0.25125 x number of ECPUs sessions (up to 100 concurrent queries). A decimal result is truncated.

In this example the MEDIUM service supports an application with up to 100 concurrent queries with DOP of 4. If you only need 50 concurrent queries and you want a higher DOP you can decrease the concurrency limit and the database increases the DOP. To do this, set the MEDIUM service concurrency limit to 50. When you change the concurrency limit the database calculates and sets the DOP based on the concurrency limit you select and the number of ECPUs. For this example, with the concurrency limit set to 50, the new DOP is 12.

With Compute auto scaling enabled, the DOP is set to a value three times greater. In this example the DOP value would be 36.

You can change the concurrency limit for the MEDIUM service in Database Actions or using the PL/SQL package CS_RESOURCE_MANAGER.UPDATE_PLAN_DIRECTIVE.

Follow these steps to change the MEDIUM service concurrency limit in Database Actions:

  1. Access Database Actions as the ADMIN user.

    See Access Database Actions as ADMIN for more information.

  2. On the Database Actions Launchpad, under Administration, click Set Resource Management Rules.

  3. On the Set Resource Management Rules page, select the Concurrency limit tab.

    Description of adb_set_concurrency_limit_ecpu.png follows

    Description of the illustration adb_set_concurrency_limit_ecpu.png

  4. For the MEDIUM service, change the value to the desired concurrency limit by entering a value or by clicking the Decrement or Increment icons.

    If the concurrency limit you specify is not valid, based on the number of ECPUs, you will receive a message such as the following, listing the valid range of values for your instance:

    Enter a number between 1 and 12.
  5. Click Save Changes.

  6. Click OK.

To reset the concurrency limit for the MEDIUM service to its default value, click Load Default Values and click Save Changes.

Change MEDIUM Service Concurrency Limit with PL/SQL Procedure UPDATE_PLAN_DIRECTIVE (ECPU Compute Model)

As an alternative to using the Set Resource Management Rules card in Database Actions, you can use PL/SQL to change the concurrency limit for the MEDIUM service.

To change the MEDIUM service concurrency limit with CS_RESOURCE_MANAGER.UPDATE_PLAN_DIRECTIVE:

  1. Call the PL/SQL procedure CS_RESOURCE_MANAGER.UPDATE_PLAN_DIRECTIVE to update the concurrency limit for the MEDIUM consumer group.

    For example, with 12 ECPUs, change the MEDIUM service's concurrency limit to 2, as follows:

    BEGIN
        CS_RESOURCE_MANAGER.UPDATE_PLAN_DIRECTIVE(consumer_group => 'MEDIUM', concurrency_limit => 2);
    END;
    /

    If the concurrency_limit you specify is not valid, based on the number of ECPUs, the procedure shows an error message, listing the valid range of values for your instance. For example with 12 ECPUs:

    ORA-20000: Invalid or missing value. Concurrency limit must be between 1 and 9 for the specified CPU count

    This error message example is from an instance with 12 ECPUs.

  2. Use the PL/SQL function CS_RESOURCE_MANAGER.LIST_CURRENT_RULES to verify the updated MEDIUM service concurrency limit and degree of parallelism:

    SELECT * FROM CS_RESOURCE_MANAGER.LIST_CURRENT_RULES();

    This procedure returns the list of values for all consumer groups. After you modify the concurrency limit as specified in Step 1, check the MEDIUM service CONCURRENCY_LIMIT and DEGREE_OF_PARALLELISM values to verify your changes.

  3. After you change the concurrency limit for the MEDIUM service, test your application by connecting with the MEDIUM service to verify that the customized concurrency limit meets your performance objectives.

When you want to go back to the default values, use the CS_RESOURCE_MANAGER.REVERT_TO_DEFAULT_VALUES PL/SQL procedure to revert to the default settings for the MEDIUM service.

For example:

BEGIN
    CS_RESOURCE_MANAGER.REVERT_TO_DEFAULT_VALUES(consumer_group => 'MEDIUM', concurrency_limit => TRUE);
END;
/

See CS_RESOURCE_MANAGER Package for more information.

Change MEDIUM Service Concurrency Limit Notes (ECPU Compute Model)

Related Topics

Change MEDIUM Service Concurrency Limit (OCPU Compute Model)