All Products
Search
Document Center

Database Autonomy Service:Prediction-based auto scaling

Last Updated:Nov 15, 2024

Database Autonomy Service (DAS) provides the prediction-based auto scaling feature to handle business growth and heavy database loads. This feature allows DAS to predict the metric values of an instance for the next 24 hours based on the historical data of the instance over the last 10 days. This feature also provides suggestions if the value of the prediction metric reaches the threshold. This topic describes how to create a prediction-based auto scaling policy.

Prerequisites

  • The database instance that you want to manage is of one of the following types:

    • ApsaraDB RDS for MySQL

    • PolarDB for MySQL

    • Tair (Redis OSS-compatible)

  • A service-linked role is created for DAS. For more information, see AliyunServiceRoleForDAS role.

Procedure

  1. Log on to the DAS console.

  2. Create a prediction-based auto scaling policy.

    • Create a prediction-based auto scaling policy on the Management and Settings page.

      1. In the left-side navigation pane, click Management and Settings.

      2. In the Auto Scaling Policies section, click Add Policy. In the Add Policy panel, configure the parameters that are described in the following table.

        Table 1. Parameters

        Parameter

        Description

        Policy Name

        The name of the policy.

        Mode

        The mode of the policy. Select Prediction-based Auto Scaling.

        Note

        In this mode, DAS provides scaling suggestions but does not perform scaling operations.

        Engine Type

        The type of the database engine.

        Metric Type

        • The type of the metric whose value you want to predict. If you select RDS MySQL or PolarDB MySQL as the engine type, only CPU Utilization (%) is available for the Metric Type parameter.

        • If you select Redis as the engine type, only Memory Usage (%) is available for the Metric Type parameter.

        Destination Value

        The predefined value of the prediction metric. If the predicted value of a metric is greater than or equal to the predefined value, scaling suggestions are provided.

      3. Click Next Step. In the Apply Policies dialog box, select the database instances to which you want to apply the policy and click the xy icon.

      4. Click Confirm to apply the policy to the selected database instances.

        Alternatively, you can perform the following steps to apply the policy to a database instance: In the Auto Scaling Policies section, find the policy that you created and click Apply in the Actions column. In the Apply Policies dialog box, select the database instances to which you want to apply the policy, click the rightwards arrow, and then click Confirm.

    • Create a prediction-based auto scaling policy on the Autonomous Function Settings tab of the Autonomous Function Management panel.Autonomy Service Settings

      1. In the left-side navigation pane, click Instance Monitoring.

      2. On the Instance Monitoring page, find the database instance for which you want to create a prediction-based auto scaling policy and click the instance ID.

      3. On the instance details page, click Autonomy Service Settings in the upper-right corner.

      4. On the Autonomous Function Settings tab of the Autonomous Function Management panel, click the Auto Scaling tab. In the Applied Policies section, click Add Policy to create a prediction-based auto scaling policy for the database instance. For more information, see the "Table 1. Parameters" section of the Automatic scaling for local resources topic.

      5. In the Recommended Policies section, find the policy that you created and click Apply in the Actions column.

        Note
        • To modify a policy, click Modify in the Actions column of the policy. In the Update Policy panel, update the policy settings.

        • If you no longer want to apply a policy to your instance, click Cancel in the Actions column of the policy in the Applied Policies section.

      6. Click OK.

      7. In the Alert Configuration section, configure an alert template and subscribe to alert notifications. This helps you understand the status of a prediction-based auto scaling task at the earliest opportunity.

        The system recommends an alert template and adds alert rules for the required autonomy events in the alert template. You can configure the alert template as prompted.

        Note
        • If you have configured an alert template for your database instance, you must add alert rules for the required autonomy event to the alert template as prompted.

        • For more information about how to configure an alert template and alert rules for your database instance, see Configure alert templates and Configure alert rules.

      8. In the Select Contact Group section, select an alert contact group.

        • Click Add Contact to add an alert contact.

        • Click Create Contact Group to create an alert contact group.

        • Find the alert contact that you want to manage and click Edit or Remove in the Actions column to modify or delete information about the alert contact.

        For more information, see Manage alert contacts.

      9. Click Submit Configuration. In the dialog box that appears, confirm the configuration.

View the results of prediction-based auto scaling

  1. In the left-side navigation pane of the DAS console, click Instance Monitoring.

  2. On the Instance Monitoring page, find the database instance for which prediction-based auto scaling is enabled and click its ID.

  3. In the left-side pane of the instance details page, click Autonomy Center.

  4. On the Autonomy Center page, select a time range to view the auto scaling events that occurred within the selected time range.

  5. Click Details in the Event: Database Workload Prediction section to view the details of prediction-based auto scaling.

    tx

References

You can perform scaling operations on your database instances based on the provided suggestions. For more information about how to perform scaling operations, see the following topics: