When you use AnalyticDB for PostgreSQL, the data size and computing workload may surge and the data processing speed may hit a bottleneck due to insufficient computing resources such as CPU, memory, disk space, and data processing nodes. AnalyticDB for PostgreSQL allows you to change instance specifications and dynamically scale instances. This topic describes how to change the specifications of compute nodes.

Precautions

The following table describes how specification changes are supported for different resource types of AnalyticDB for PostgreSQL.

Operation Serverless Elastic storage mode Reserved storage mode
Upgrade node specifications Not supported Supported Supported
Downgrade node specifications Not supported Supported Not supported
Add compute nodes Supported Supported Supported
Remove compute nodes Supported Not supported Not supported

Time required to change specifications

  • Elastic storage mode and reserved storage mode

    It can take from 30 minutes to several hours to upgrade specifications. The exact amount of time depends on a variety of factors such as the number of tables, the number of partitions, the number of indexes, compression status, total data size, and instance specifications. During this process, two service interruptions occur and the instances remain read-only to ensure data consistency. We recommend that you take precautions. After you complete the upgrade, the instance returns to the Running state and is updated to the latest minor version. You can connect to the instance.

  • Serverless mode

    You can scale AnalyticDB for PostgreSQL instances in Serverless mode within a few minutes without the need to migrate data. The scale speed varies based on the amount of time required to apply for resources and is not affected by the data size. The following scaling performance is provided for reference:

    • An instance that has 16 or fewer compute nodes can be scaled within 60 seconds.
    • An instance that has more than 16 compute nodes can be scaled within 5 minutes.

Upgrade node specifications

  1. Log on to the AnalyticDB for PostgreSQL console.
  2. In the upper-left corner of the console, select the region where the instance resides.
  3. Find the instance that you want to manage and click its ID.
  4. In the upper-right corner of the Basic Information page, choose Manage Instance > Change Compute Node Specifications > Upgrade Node Specifications.
  5. On the Upgrade/Downgrade page, configure the parameters described in the following table.
    Parameter Description
    Instance Resource Type The resource type of the current instance is displayed and cannot be modified.
    Compute Node Specifications Select node specifications based on your business requirements.
    Single Node Storage Capacity Select a storage capacity per node based on your business requirements.
    Note The storage capacity cannot be downgraded.
  6. Read and select the Terms of Service, and then click Buy Now.
    Warning During the specification change process, two service interruptions occur and the instances remain read-only. Proceed with caution.
  7. Return to the Instances page and wait for the instance to change to the Running state.

Downgrade node specifications

  1. Log on to the AnalyticDB for PostgreSQL console.
  2. In the upper-left corner of the console, select the region where the instance resides.
  3. Find the instance that you want to manage and click its ID.
  4. In the upper-right corner of the Basic Information page, choose Manage Instance > Change Compute Node Specifications > Upgrade Node Specifications.
  5. On the Upgrade/Downgrade page, configure the parameters described in the following table.
    Parameter Description
    Instance Resource Type The resource type of the current instance is displayed and cannot be modified.
    Compute Node Specifications Select node specifications based on your business requirements.
    Note Compute node specifications cannot be downgraded for instances in reserved storage mode.
    Single Node Storage Capacity Select a storage capacity per node based on your business requirements.
    Note The storage capacity cannot be downgraded.
  6. Read and select the Terms of Service, and then click Buy Now.
    Warning During the specification change process, two service interruptions occur and the instances remain read-only. Proceed with caution.
  7. Return to the Instances page and wait for the instance to change to the Running state.

Add compute nodes

  1. Log on to the AnalyticDB for PostgreSQL console.
  2. In the upper-left corner of the console, select the region where the instance resides.
  3. Find the instance that you want to manage and click its ID.
  4. In the upper-right corner of the Basic Information page, choose Manage Instance > Change Compute Node Specifications > Add Compute Node.
  5. Optional:In the Info dialog box, select I am aware of the impact of this operation and agree to continue it. and click OK.
    Note This step is available only for instances in Serverless mode.
  6. On the Upgrade/Downgrade page, select a value for the Nodes parameter based on your business requirements, read and select the Terms of Service, and then click Buy Now.
    Warning
    • For instances in elastic storage mode and reserved storage mode, two service interruptions occur and the instances remain read-only during the specification change process. Proceed with caution.
    • For instances in Serverless mode, after you submit a specification change request, the current SQL statements are interrupted and cannot be resumed even after the specifications are changed.
  7. Return to the Instances page and wait for the instance to change to the Running state.
  8. Optional:Execute the following SQL statement to prefetch data from tables that have high performance requirements to accelerate data access:
    SELECT count(*) FROM <hot_table>;
    Note
    • Data can be prefetched only for AnalyticDB for PostgreSQL instances in Serverless mode.
    • When compute nodes are added or removed, five steps are performed: the resources are initialized, the metadata information about system tables is synchronized, the resources are locked to modify the data distribution information, the resources are unlocked and cleared, and the local cache is asynchronously restored. The hit ratio of the local cache remains low for a short period of time because the local cache is asynchronously restored. You can prefetch data to accelerate data access.

Remove compute nodes

  1. Log on to the AnalyticDB for PostgreSQL console.
  2. In the upper-left corner of the console, select the region where the instance resides.
  3. Find the instance that you want to manage and click its ID.
  4. In the upper-right corner of the Basic Information page, choose Manage Instance > Change Compute Node Specifications > Remove Compute Node.
  5. Optional:In the Info dialog box, select I am aware of the impact of this operation and agree to continue it. and click OK.
    Note This step is available only for instances in Serverless mode.
  6. On the Upgrade/Downgrade page, select a value for the Nodes parameter based on your business requirements, read and select the Terms of Service, and then click Buy Now.
    Warning After you submit a specification change request, the current SQL statements are interrupted and cannot be resumed even after the specifications are changed.
  7. Return to the Instances page and wait for the instance to change to the Running state.
  8. Optional:Execute the following SQL statement to prefetch data from tables that have high performance requirements to accelerate data access:
    SELECT count(*) FROM <hot_table>;
    Note
    • Data can be prefetched only for AnalyticDB for PostgreSQL instances in Serverless mode.
    • When compute nodes are added or removed, five steps are performed: the resources are initialized, the metadata information about system tables is synchronized, the resources are locked to modify the data distribution information, the resources are unlocked and cleared, and the local cache is asynchronously restored. The hit ratio of the local cache remains low for a short period of time because the local cache is asynchronously restored. You can prefetch data to accelerate data access.