All Products
Search
Document Center

Database Autonomy Service:Prediction-based auto scaling

Last Updated:Jun 20, 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

    • ApsaraDB for Redis

  • A service-linked role for DAS is created. 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 Autonomy Service Settings tab of the Autonomous Function Management panel.

      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.

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 tab, specify a time range and view the auto-scaling events that occurred within the specified 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: