All Products
Search
Document Center

ApsaraDB RDS:Reduce the storage capacity of an ApsaraDB RDS for PostgreSQL instance that uses cloud disks

Last Updated:Jan 12, 2024

If your actual storage usage is much smaller than the storage capacity that you purchased for your ApsaraDB RDS for PostgreSQL instsance, you can use the manual storage reduction feature to reduce the storage capacity. This prevents resource waste.

Note

The automatic storage expansion feature is enabled for your RDS instance. However, automatic storage reduction is not supported. After the workloads are reduced, you can use the manual storage reduction feature to reduce the storage capacity.

Prerequisites

  • Your RDS instance must meet the following requirements:

    • The RDS instance runs PostgreSQL 10 or later.

    • The RDS instance uses ESSDs. ESSDs come in the following performance levels (PL): PL1, PL2, and PL3.

    • The RDS instance runs RDS Basic Edition or RDS High-availability Edition.

    Note
    • You can go to the Basic Information page of the RDS instance to view the preceding information.

    • If your RDS instance is created before October 10, 2022 and uses an original architecture, you must update the minor engine version to the latest version and then reduce the storage capacity of the RDS instance. For more information, see Update the minor engine version.

    • If your RDS instance uses local disks, we recommend that you use the major version upgrade feature to upgrade the RDS instance to an instance that runs a later major engine version and uses cloud disks. You can reduce the storage capacity of your RDS instance when you upgrade the major engine version. For more information, see Upgrade the major version of an ApsaraDB RDS for PostgreSQL instance.

  • Your Alibaba Cloud account does not have overdue renewal orders.

    You can go to the Orders page to check whether unpaid orders exist. If an unpaid order exists, you must complete the payment or cancel the order.

  • The RDS instance is in the Running state.

  • When you reduce the storage capacity of a read-only RDS instance, the primary RDS instance of the read-only RDS instance is in the Running state.

Limits

  • You can manually reduce the storage capacity of an RDS instance that uses cloud disks up to twice a day. This prevents your services from being negatively affected.

  • You can reduce the storage capacity of your RDS instance without the need to change the RDS edition or architecture of the RDS instance. The minimum storage capacity after the storage capacity reduction must be greater than or equal to the minimum storage capacity that is supported by the instance type of the RDS instance. You can use the following formula to calculate the minimum storage capacity to which you can reduce your RDS instance: min{Used storage × 1.3, Used storage + 400 GB}. You can reduce the storage capacity at a step size of 5 GB.

    The following list describes the minimum storage capacity that is allowed for each performance level (PL) of ESSDs:

    • PL1 ESSD: 20 GB

    • PL2 ESSD: 500 GB

    • PL3 ESSD: 1,500 GB

    Examples

    Your RDS instance provides 2,000 GB of storage capacity and uses the PL1 ESSD storage type.

    • If 10 GB of storage is used, the value obtained by using the preceding formula is 13 GB. In this case, the minimum storage capacity to which you can reduce your RDS instance is 20 GB.

    • If 500 GB of storage is used, the value obtained by using the preceding formula is 650 GB. In this case, the minimum storage capacity to which you can reduce your RDS instance is 650 GB.

    • If 1,500 GB of storage is used, the value obtained by using the preceding formula is 1,900 GB. In this case, the minimum storage capacity to which you can reduce your RDS instance is 1,900 GB.

  • The storage capacity of a read-only RDS instance must be greater than or equal to the storage capacity of its primary RDS instance. We recommend that you reduce the storage capacity of the primary RDS instance and then the storage capacity of its read-only RDS instances.

Impacts

When you reduce the storage capacity of your RDS instance that uses ESSDs, a 30-second transient connection occurs. During the transient connection, you cannot perform most of the operations that are related to databases, accounts, and network settings. We recommend that you reduce the storage capacity of your RDS instance that uses ESSDs during off-peak hours. Make sure that your application is configured to automatically reconnect to your RDS instance.

Billing

For more information about billing rules, see Specification changes.

Procedure

Non-serverless RDS instances

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the Configuration Information section of the page that appears, click Change Specifications.

  3. Optional. In the dialog box that appears, click Downgrade and click Next step. This step is required only when the RDS instance uses the subscription billing method.

  4. Drag the slider or click the minus icon to specify a new value for the Storage Capacity parameter.

    Note

    The minimum storage capacity to which you can reduce your RDS instance is calculated by using the following formula: min{Used storage × 1.3, Used storage + 400 GB}. The minimum storage capacity after the storage capacity reduction must be greater than or equal to the minimum storage capacity that is supported by the instance type of the RDS instance. You can reduce the storage capacity at a step size of 5 GB.

  5. Configure the Switching Time parameter.

    Storage capacity reduction triggers data migration. You can set this parameter to Execute Immediately or Switch Within Maintenance Window.

    • Execute Immediately: Your data is immediately migrated, which does not affect workloads on the RDS instance. After the data is migrated, the system switches your workloads. A transient connection occurs during the switchover.

    • Switch Within Maintenance Window: Your data is immediately migrated, which does not affect workloads on the RDS instance. After the data is migrated, the system switches your workloads within the maintenance window that you specified. A transient connection occurs during the switchover. For more information, see Set the maintenance window of an ApsaraDB RDS for PostgreSQL instance.

  6. Read and select the Terms of Service and click Pay Now.

  7. In the Instance Information Comparison dialog box, confirm the instance information before and after the specification change and click Continue to complete the payment.

Serverless RDS instances

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the Usage Statistics section, click Modify next to Storage Capacity.

  3. On the Modify tab, drag and drop the slider or click the minus icon to adjust the value of the Storage Capacity parameter. Then, click OK.

    Note

    The minimum storage capacity to which you can reduce your RDS instance is calculated by using the following formula: min{Used storage × 1.3, Used storage + 400 GB}. The minimum storage capacity after the storage capacity reduction must be greater than or equal to the minimum storage capacity that is supported by the instance type of the RDS instance. You can reduce the storage capacity at a step size of 5 GB.

  4. In the Adjust Scaling Settings dialog box, confirm the information and click OK.

    When the value of the Status parameter changes to Upgrading/Downgrading, the storage capacity of the RDS instance is being reduced.

FAQ

  • When I reduce the storage capacity of my RDS instance that uses cloud disk, how long does a transient connection last?

    The transient connection lasts for approximately 30 seconds. During the transient connection, you cannot perform most of the operations that are related to databases, accounts, and network settings. We recommend that you reduce the storage capacity of your RDS instance that uses ESSDs during off-peak hours. Make sure that your application is configured to automatically reconnect to your RDS instance.

  • How do I reduce the storage capacity of my RDS instance that uses standard SSDs?

    Standard SSDs are no longer available for purchase. If you want to reduce the storage capacity of your RDS instance that uses standard SSDs, you can upgrade the storage type from standard SSD to ESSD and then reduce the storage capacity. For more information, see [EOS/Discontinuation] End of sale for the standard SSD storage type for specific database engines in ApsaraDB RDS from July 01, 2022.

References

  • For more information about how to change other specifications of an RDS instance, see Change instance specifications.

  • You can call the following operation to modify the storage capacity or change other specifications of an instance.

    Operation

    Description

    ModifyDBInstanceSpec

    Reduces the storage capacity of an instance. When you call this operation to reduce the storage capacity of an instance that uses cloud disks, you must set the DBInstanceStorage parameter to the new storage capacity and configure other parameters based on your business requirements.