When to choose smooth scale-out

Updated at:

PolarDB-X 1.0 smooth scale-out increases the number of Private Custom RDS instances to improve overall performance. When the IOPS, CPU, and disk capacity metrics of a Private Custom RDS instance reach their limits and the bottleneck cannot be resolved through SQL optimization or Private Custom RDS upgrades (for example, when the disk has reached the maximum specification), you can use the PolarDB-X 1.0 horizontal scaling feature to increase the number of Private Custom RDS instances and increase the capacity of the PolarDB-X 1.0 database.

PolarDB-X 1.0 smooth scale-out reduces the load on the source Private Custom RDS instance by migrating sharded databases to a new Private Custom RDS instance. For example, before a scale-out, the load from eight databases is concentrated on a single Private Custom RDS instance. After the scale-out, the eight databases are deployed on two Private Custom RDS instances, which significantly reduces the load on each Private Custom RDS instance.

Note

After multiple smooth scale-outs, if the number of Private Custom RDS instances equals the number of sharded databases, you must create another PolarDB-X 1.0 instance and a database with the expected capacity and number of Private Custom RDS instances, and then perform data migration to achieve larger-scale data capacity expansion. This process is complex. We recommend that you consider the expected data growth for the next two to three years when you create a PolarDB-X 1.0 database, and plan the number of Private Custom RDS instances accordingly.

Determine whether smooth scale-out is needed

You can monitor the IOPS, CPU, and disk space metrics of your Private Custom RDS instance to determine whether smooth scale-out is needed for PolarDB-X 1.0.

In the RDS console, you can also set specific alert rules for these metrics. The default alert policies and thresholds are as follows.

The following four alert items are included by default, with a statistical period of 5 minutes: IOPS Usage, Connection Usage, CPU Usage, and Disk Space Usage. An alert is triggered when the average value of any metric reaches or exceeds 80% three times. The alert feature is provided by Cloud Monitor.

CPU and IOPS metrics

  • CPU monitoring information on the RDS platform.

    On the Monitoring and Alerts > Monitoring > Resource Monitoring page of the RDS console, you can view the trend chart of CPU and Memory Utilization (%) over time. You can select a time range of 1 Hour, 1 Day, 7 Days, or 1 Month.

  • RDS limits the frequency of I/O operations, which is reflected in the IOPS metric.

For the preceding two metrics, if either metric consistently stays above 80% or you frequently receive alert notifications, consider the following steps:

  1. Try SQL optimization. Issues with high CPU utilization can usually be resolved at this step.

  2. If SQL optimization does not resolve the issue, you can upgrade the specifications of the RDS instance.

  3. If CPU and IOPS usage exceeds the limits, you can set up read-only instances to share the load of the primary database. Note that read/write splitting affects read consistency.

  4. If the preceding steps do not resolve the issue, consider PolarDB-X 1.0 scale-out.

Disk space

RDS disk space includes the following types:

  1. Data space: the space occupied by data. This space usage grows as data is inserted. We recommend that you keep at least 30% of disk storage capacity free.

  2. System file space: includes shared tablespaces and error log files.

  3. Binlog file space: the space generated during database operations. The more update transactions, the more space is used.

To determine whether a scale-out is needed, focus on Data Space. When the data space is about to or is expected to exceed the disk capacity, you can scale out to distribute the data across multiple RDS instances.

Scale-out risks and notes

The PolarDB-X 1.0 scale-out process consists of four steps: Configuration > Migration > Switch > Cleanup.

Before you scale out, note the following:

  • If you need to add five or more RDS instances, Contact us in advance to prevent migration failures due to insufficient backend resources.

  • The scale-out process increases the read pressure on the source RDS instance. We recommend that you perform this operation when the load on the source RDS instance is low.

  • During the scale-out, do not submit DDL tasks in the console or connect to PolarDB-X 1.0 to execute DDL SQL statements. Otherwise, the scale-out task fails.

  • The scale-out requires that tables in the source database have primary keys. If they do not, you must add primary keys before you start the scale-out.

  • The switch action redirects read and write traffic to the new RDS instances. The switch process takes about 3 to 5 minutes. We recommend that you perform the switch when your services are stopped.

  • Before the switch, the scale-out does not affect PolarDB-X 1.0. You can roll back to cancel the scale-out at any time before the switch.

  • The scale-out operation places additional load on the database. We recommend that you perform this operation during off-peak hours.