This topic describes how to set the protection level of an ApsaraDB RDS for PostgreSQL instance based on your business requirements. A proper protection level increases the availability and performance of your database service.

Prerequisites

Your RDS instance runs the High-availability Edition with standard or enhanced SSDs.

Background information

You can configure the following parameters to set the protection level of your RDS instance: synchronous_commit, rds_sync_replication_timeout, and synchronous_standby_names.

ApsaraDB RDS for PostgreSQL provides the following three protection levels:

  • Optimum performance

    This is the default protection level. If you select this protection level, your RDS instance runs in asynchronous mode. This protection level delivers the highest response speed but medium data persistence. To enable this protection level, you must set the synchronous_commit parameter to off.

    Note If you set the synchronous_commit parameter to off, the rds_sync_replication_timeout parameter is invalid.
  • Optimum protection

    If you select this protection level, your RDS instance runs in synchronous mode. This protection level delivers high data persistence but medium response speed. To enable this protection level, you must specify the following parameter settings:

    • synchronous_commit = remote_write
    • rds_sync_replication_timeout = 0
    • synchronous_standby_names = standby1
    Warning The default value of the synchronous_standby_names parameter is standby1. If you have a self-managed secondary RDS instance, we recommend that you do not name the self-managed secondary RDS instance as standby1. If you name the self-managed secondary RDS instance as standby1, ApsaraDB RDS cannot replicate data from your RDS instance to its secondary RDS instance in synchronous or semi-synchronous mode. As a result, data losses may occur in the event of a primary/secondary switchover.
  • High availability

    If you select this protection level, your RDS instance runs in semi-synchronous mode. This protection level balances data persistence and response speed. To enable this protection level, you must specify the following parameter settings:

    • synchronous_commit = remote_write
    • rds_sync_replication_timeout > 0
      Note The rds_sync_replication_timeout parameter specifies the data synchronization timeout period in milliseconds. The value of this parameter ranges from 0 to 300000. If a synchronization times out, the high availability protection level is decreased to the optimum performance protection level that makes your RDS instance run in asynchronous mode. After data is synchronized, the optimum performance protection level is increased to the high availability protection level that makes your RDS instance run in semi-synchronous mode.

Procedure

  1. Go to the Basic Information page.
    1. Log on to the ApsaraDB for RDS console. In the left-side navigation pane, click Instances. In the top navigation bar, select the region where your RDS instance resides.
      选择地域
    2. Find your RDS instance and click its ID. In the left-side navigation pane, click Parameters.
  2. On the Editable Parameters tab, find the synchronous_commit, rds_sync_replication_timeout, and synchronous_standby_names parameters.
  3. In the Running Parameter Value column for each parameter, click the icon next to the original value. In the dialog box that appears, enter the new value and click OK.
    Note For more information about how to configure the parameters, see the "Background information" section of this topic.
  4. In the upper-left corner of the page, click Submit Changes.
    Warning If your RDS instance restarts after you submit the new value of the rds_sync_replication_timeout parameter, your application is disconnected from your RDS instance. We recommend that you reconfigure this parameter during off-peak hours.
    Submit Changes button