Help Center/ GaussDB(for MySQL)/ User Guide/ Instance Management/ Configuration Changes/ Configuring Auto Scaling for a DB Instance
Updated on 2024-11-06 GMT+08:00

Configuring Auto Scaling for a DB Instance

Scenarios

You can configure auto scaling policies for your pay-per-use and yearly/monthly DB instances on the Basic Information page. When configuring auto scaling policies, you can enable or disable Auto Scale-up or Auto Scale-down. The scaling types include changing instance specifications and the number of read replicas.

Constraints

  • This function is only available for pay-per-use and yearly/monthly DB instances.
  • To set Scaling Type to Number of read replicas for a yearly/monthly DB instance, submit an application by choosing Service Tickets > Create Service Ticket in the upper right corner of the management console. The read replicas that are automatically added or deleted will be billed based on a pay-per-use basis.
  • To configure auto scaling policies, you must have the iam:agencies:listAgencies permission. If you do not have this permission, create a custom policy.
  • Changing DB instance specifications will briefly interrupt services.
  • If you want to set Scaling Type to Number of read replicas, there must be only one proxy instance. For details, see How to Use a Proxy Instance to Enable Read/Write Splitting.
  • The system will delete or add read replicas. To prevent your services from being affected, you are advised not to use an IP address for read to connect to your applications.
  • The pricing standard for auto scaling is the same as that for manual scaling. For details, see Billing.

Billing

  • Pay-per-Use Instances

    The instance specifications and number of read replicas can be automatically changed.

    Pricing is listed on a per-hour basis, but bills are calculated down to the second. The old order automatically becomes invalid.

    To view the cost incurred by auto scaling, choose Billing Center > Billing Dashboard in the upper right corner of the management console.

  • Yearly/Monthly Instances

    The instance specifications and number of read replicas can be automatically changed.

    You will be billed for the new specifications. For details, see GaussDB(for MySQL) Pricing Details.

    If the new specifications are less than the specifications that you purchased, the refund is automatically returned to your account. You can click Billing Center in the upper right corner of the management console and then choose Orders > My Orders in the navigation pane on the left to view the details.

    Table 1 Pricing description for yearly/monthly instances

    Billing Item

    Description

    Specifications after scale-up

    You need to pay the following fee:

    Price of new specifications x Remaining duration x Number of nodes – Price of old specifications x Remaining duration x Number of nodes

    Note: Remaining duration = Number of remaining days in a calendar month/Total number of days in the calendar month

    Example:

    A customer placed and paid a monthly order for a GaussDB(for MySQL) instance on April 1, 2023. The instance contains 2 nodes and its specifications are 2 vCPUs and 8 GB of memory. The total subscription period would be 30 days and the instance would expire on April 30, 2023. On April 18, 2023, the instance specifications were automatically expanded to 4 vCPUs and 16 GB memory. The remaining duration is 0.4 (12/30).

    The monthly price of the new specifications is $290 USD and that of the old specifications is $145 USD, so you need to pay for $116 USD (290 x 0.4 x 2 – 145 x 0.4 x 2).

    Specifications after scale-down

    For pricing details, see Unsubscriptions.

    Added read replicas

    New read replicas are billed based on the actual usage duration.

    Deleted read replicas

    Deleted read replicas are no longer billed.

Modifying Auto Scaling Policies

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner of the page and choose Databases > GaussDB(for MySQL).
  4. On the Instances page, click the instance name to go to the Basic Information page.
  5. In the Configuration area, click Modify under Auto Scaling.

    Figure 1 Modifying auto scaling policies

  6. In the displayed dialog box, set the required parameters.

    Figure 2 Modifying the auto scaling policy

    Table 2 Parameter configuration

    Parameter

    Parameter description

    Auto Scale-up

    You can enable or disable it as needed.

    Scaling Type

    • Instance specifications
    • Number of read replicas
    NOTE:
    • You can select one or more scaling types.
    • The read replicas that are automatically added or deleted will be billed based on a pay-per-use basis.
    • If you deselect Number of read replicas for Scaling Type, pay-per-use nodes created in the current instance will be automatically deleted. Exercise caution when performing this operation.
    • The account balance must be sufficient, or scaling up the specifications or adding read replicas may fail.
    • After Auto Scale-up is enabled, read replicas that are automatically added cannot be promoted to primary.

    Observation Period

    • Once auto scale-up is enabled, if the system observes any increases in the average CPU usage over the preset value, it upgrades the specifications or adds read replicas based on the read and write traffic. The system enters a silent period after each scale-up.
    • The minimum observation period is 5 minutes.

    Average CPU Usage

    Indicates threshold for triggering an auto scale-up.

    Allowed range: 50%–100%

    Max. Specifications

    Indicates the maximum specifications after the final auto scale-up. The specifications can only be scaled up gradually and the system enters the silent period after each scale-up.

    Max. Read Replicas

    Only one read replica can be added at a time.

    Replica Read Weight

    If you have enabled read/write splitting, the new read replicas are automatically associated with the proxy instance.

    Auto Scale-down

    You can enable or disable it as needed.

    NOTE:

    Once auto scale-down is enabled, if the system observes an average CPU usage of 99% drops below 30% within the observation period, it gradually restores the original configuration. The system enters a silent period after each scale-down.

    Silent Period

    The silent period is the minimum interval between two changes (triggered automatically or manually), where no more changes can happen.

  7. Click OK.

Viewing Change History

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner of the page and choose Databases > GaussDB(for MySQL).
  4. On the Instances page, click the instance name to go to the Basic Information page.
  5. In the Configuration area, click View Change History under Auto Scaling.
  6. In the displayed dialog box, view the change time, change type, status, original specifications, and new specifications.