This topic describes how to set the protection level of an ApsaraDB RDS for PostgreSQL instance based on your business needs. Protection levels help you increase the availability and performance of your RDS instance.

Prerequisites

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

Background information

You can set the protection level of your RDS instance by configuring the following two parameters: synchronous_commit and rds_sync_replication_timeout.

RDS for PostgreSQL provides the following three protection levels:

  • Optimal performance

    The asynchronous mode. This is the default protection level, which delivers high response speed but medium data persistence. To enable this protection level, set the synchronous_commit parameter to off.

    Note If the synchronous_commit parameter is set to off, the rds_sync_replication_timeout parameter does not take effect.
  • Maximum protection

    The synchronous mode. This protection level delivers high data persistence but medium response speed. To enable this protection level, configure the following parameters:

    • Set the synchronous_commit parameter to remote_write.
    • Set the rds_sync_replication_timeout parameter to 0.
  • High availability

    The semi-synchronous mode. This protection level balances data persistence and response speed. To enable this protection level, configure the following parameters:

    • Set the synchronous_commit parameter to remote_write.
    • Set the rds_sync_replication_timeout parameter to 0.
      Note The rds_sync_replication_timeout parameter specifies the data synchronization timeout period measured in milliseconds. The value of this parameter ranges from 0 to 300000. If a synchronization times out, the protection level is demoted to the optimal performance level, namely, the asynchronous mode. After data is synchronized, the protection level is promoted back to the high availability level.

Procedure

  1. Log on to the ApsaraDB for RDS console.
  2. In the top navigation bar, select the region where the target RDS instance resides.
  3. Find the target RDS instance and click its ID.
  4. In the left-side navigation pane, click Parameters.
  5. On the Editable Parameters tab, find the synchronous_commit and rds_sync_replication_timeout parameters.
    Modify parameter settings
  6. Click the icon for each parameter. In the dialog box that appears, enter the value of the parameter and click Confirm.
    Note For more information about how to configure the parameters, see the "Background information" section.
  7. In the upper-right corner of the page, click Apply Changes.
    Warning If you restart the RDS instance after you apply the new value of the rds_sync_replication_timeout parameter, the RDS instance is disconnected. We recommend that you reconfigure this parameter during off-peak hours.
    Apply parameter changes