Database Autonomy Service (DAS) allows you to configure scheduled auto scaling policies to scale up and back instance specifications. This feature helps you manage predictable periodic changes in database loads and control costs while meeting business requirements.

Prerequisites

  • The following types of databases are supported:
    • ApsaraDB RDS for MySQL instances on RDS High-availability Edition with standard SSDs or enhanced SSDs (ESSDs). The instances belong to the general-purpose instance family.
    • PolarDB for MySQL clusters on Cluster Edition of the General-purpose and Dedicated instance specifications
    • Master-replica standard instances of ApsaraDB for Redis Community Edition and performance-enhanced standard instances of ApsaraDB for Redis Enhanced Edition (Tair). Standard SSDs or ESSDs are used in these instances to store data.
  • A DAS-linked role is created. For more information, see AliyunServiceRoleForDAS role.
  • Your Alibaba Cloud account has sufficient balance to pay for the costs of scaled-up resources.

Precautions

  • All time-related parameters are in UTC+8. If you are not in this time zone, you must convert the time before you configure the parameters.
  • You can apply only one auto scaling policy of each mode on an instance.
  • Retry intervals are not supported for scheduled auto scaling policies. If a scheduled auto scaling policy fails to be executed, the execution is not retried.
  • In the following scenarios, the instance may not be scaled back to its previous specifications even if the Duration or Scale-back Time parameter is specified:
    • The specifications of the instance are manually or automatically changed again after the scheduled auto scaling policy is executed. If the instance specifications are different from those specified in the policy, the instance is not scaled back.
    • One or more metrics of the instance do not meet specific standards. For example, assume that the memory of an instance is scaled up from 1 GB to 4 GB based on a scheduled auto scaling policy. If 1 GB of memory has been used before the instance is scaled back, the scale-back will not be performed, because the memory usage would be 100%. This ensures the stability and security of your business.
    • The instance is in a state in which specification changes are not allowed, such as the Changing Specifications and Migrating states.

Sample scenario

DAS performs scaling operations on your instances once or on a regular basis. It may scale your instances every day, week, or month. For example, assume that peak hours of your business start at 2:00 on the 1st day of every month and end at 2:00 on the 3rd day of every month. You can use the scheduled auto scaling feature to scale up your instances during peak hours and scale the instances back during off-peak hours.

Create a scheduled auto scaling policy

  1. Log on to the DAS console.
  2. Create a scheduled auto scaling policy.
    • Create a scheduled 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 scheduled auto scaling policy.
        Table 1. Configure parameters
        Parameter Description
        Policy Name The name of the policy.
        Mode The mode of the policy. Select Scheduled Auto Scaling.
        Engine Type The type of the database engine.
        Specifications The specifications of the selected database engine.
        Operation
        • For ApsaraDB RDS for MySQL instances and ApsaraDB for Redis instances, only Adjust Instance Specifications is supported.
        • For PolarDB for MySQL clusters, Adjust Instance Specifications and Increase Number of Read-only Nodes are supported.
        Valid From The time range during which the policy is effective.
        • Start time is a required parameter. You must set this parameter to a date later than the current date.
        • End time is an optional parameter.
          • If you set Recurrence to N/A (Execute Only Once), the scheduled auto scaling policy is executed only once and is not subject to the end time.
          • If you set Recurrence to Daily, Weekly, or Monthly and leave the End time parameter empty, the auto scaling policy is repeatedly executed based on the specified cycle. If you specify an end time, the system stops executing the policy after the end time.
        Recurrence Valid values:
        • N/A (Execute Only Once):
          • Scaling Start Time: You must configure this parameter.
          • Duration: You can configure this parameter or leave this parameter empty. Set the value of this parameter to a positive integer. Unit: hours.
            • If you leave this parameter empty, after the auto scaling policy is executed, the instance is not scaled back.
            • If you configure this parameter, after the auto scaling policy is executed, the instance is scaled back to its previous specifications.
        • Daily:
          • Scaling Start Time: You must configure this parameter.
          • Scale-back Time: You must configure this parameter.
            • If the scaling start time is earlier than the scale-back time, the two time points of a single execution of the policy are within the same day.
            • If the scaling start time is later than the scale-back time, the two time points of a single execution of the policy are not within the same day. The instance is scaled back one day after the scaling starts.
            Note
            • The scale-back time must be at least 1 hour later than the scaling start time.
            • The scaling start time must be at least 1 hour later than the scale-back time of the previous execution of the policy.
            • If the scaling start time is later than the scale-back time and an end time is specified, the system does not execute the scaling that was scheduled the day before the specified end time.
        • Weekly:
          • Scaling Start Time: You must configure this parameter.
          • Scale-back Time: You must configure this parameter.
            • If the scaling start time is earlier than the scale-back time, the two time points of a single execution of the policy are within the same week.
            • If the scaling start time is later than the scale-back time, the two time points of a single execution of the policy are not within the same week. The instance is scaled back the week after the scaling starts.
            Note
            • The scale-back time must be at least 1 hour later than the scaling start time.
            • The scaling start time must be at least 1 hour later than the scale-back time of the previous execution of the policy.
            • If the end time is set to a date between the scaling start time and scale-back time of the last execution of the policy, the last execution of the policy will not be performed.
        • Monthly
          • Scaling Start Time: You must configure this parameter.
          • Scale-back Time: You must configure this parameter.
            • If the scaling start time is earlier than the scale-back time, the two time points of a single execution of the policy are within the same month.
            • If the scaling start time is later than the scale-back time, the two time points of a single execution of the policy are not within the same month. The instance is scaled back the month after the scaling starts.
            Note
            • The scale-back time must be at least 1 hour later than the scaling start time.
            • The scaling start time must be at least 1 hour later than the scale-back time of the previous execution of the policy.
            • If the end time is set to a date between the scaling start time and scale-back time of the last execution of the policy, the last execution of the policy will not be performed.
      3. In the Auto Scaling Policies section, click Apply in the Actions column corresponding to the created policy.
      4. In the Apply Policies dialog box, select the database instances to which you want to apply the policy, and click p202202071.
      5. Click Confirm to apply the policy to the selected database instances.
    • Create a scheduled auto scaling policy on the Autonomous Function Settings tab of the Autonomous Function Management panel.
      1. In the left-side navigation pane, click Instance Monitoring.
      2. On the page that appears, find a database instance and click the instance ID. The instance details page appears.
      3. 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 Recommended Policy section, click Apply in the Actions column corresponding to a policy that you want to apply.
        Note
        • To create a scheduled auto scaling policy, click Add Policy. For information about how to configure the relevant parameters, see the "Table 1" section of this topic.
        • To modify a policy, click Modify in the Actions column corresponding to the policy. In the Update Policy panel, update the policy settings.
        • To cancel the application of a policy to the instance, click Cancel in the Actions column corresponding to the policy in the Applied Policy section.

View the results of scheduled auto scaling

  1. In the left-side navigation pane of the DAS console, click Instance Monitoring.
  2. On the page that appears, find the database instance for which scheduled auto scaling is enabled and click the instance ID. The instance details page appears.
  3. In the left-side navigation pane, click Autonomy Center.
  4. On the Autonomy Center page, select a time range and filter the auto scaling events that occurred in the selected time range.
  5. Click Details in the Auto-Scaling Events section to view the details of scheduled auto scaling events.
    p202202081