If you want to improve the performance of an ApsaraDB RDS for PostgreSQL instance or meet specific business requirements, you can modify the parameters of the RDS instance in the ApsaraDB RDS console or by calling the ApsaraDB RDS API. You can also view the parameter modification history in the ApsaraDB RDS console.
Usage notes
The modification of some parameters triggers a restart of your RDS instance. After you modify the parameters and click Apply Changes, your RDS instance immediately restarts. To check whether the modification of a parameter triggers a restart, log on to the ApsaraDB RDS console, go to the Modifable Parameters tab, and then view the value in the Force Restart column for the parameter. If the value is Yes, the modification of the parameter triggers a restart. If the value is No, the modification of the parameter does not trigger a restart. If the RDS instance restarts, your application is disconnected from the RDS instance. Make sure that you arrange your business before the restart of the RDS instance. Proceed with caution.
When you modify the parameters of your RDS instance, you can view the valid values of a parameter in the Value Range column of the parameter on the Modifable Parameters tab of the Parameters page in the ApsaraDB RDS console.
When you modify the following parameters on the primary instance of a cluster, the modification is synchronized to all read-only nodes of the cluster:
wal_level
,max_replication_slots
,max_wal_senders
, andmax_locks_per_transaction
.After you modify a parameter, the system tries to apply the modified parameter. If the modified parameter value is invalid or blocks the start of the instance, the modification is rolled back. In this case, the value in the Status column corresponding to the parameter on the Edit History tab is Failed.
Modify parameters
Log on to the ApsaraDB RDS console and 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 instance ID.
In the left-side navigation pane, click Parameters.
On the Modifable Parameters tab, modify the parameters of your RDS instance based on your business requirements.
Modify a single parameter of the RDS instance.
Find the parameter and click the icon in the Running Parameter Value column.
Enter a new value and click OK.
Click Apply Changes.
In the dialog box that appears, click OK.
If you want to reconfigure multiple parameters at a time, perform the following steps:
Click Export Parameters to download the parameter settings of your RDS instance as a file to your computer.
Open the file and modify the parameters.
Click Import Parameters.
In the Import Parameters dialog box, paste the parameter settings that you have copied from the file. Then, click OK.
Confirm the values of the modified parameters and click Apply Changes.
View the parameter configuration history
Log on to the ApsaraDB RDS console and 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 instance ID.
In the left-side navigation pane, click Parameters.
Click the Edit History tab.
Select a time range and click OK.
Configure parameters by using expressions
You can set a parameter to an expression for your RDS instance. If you set an instance type-related parameter to an expression, the value of the parameter dynamically changes when the instance type changes.
The following table describes the supported expression syntax.
Category | Description | Example |
Parameters | Note The max_parallel_maintenance_workers parameter is supported for PostgreSQL 11.0 to PostgreSQL 14.0. Other parameters are supported for PostgreSQL 10.0 to PostgreSQL 14.0. | effective_cache_size |
Variables |
Note For more information about the instance types and the storage capacity, memory capacity, number of cores, and maximum number of connections that are supported by each instance type, see Instance types for primary ApsaraDB RDS for PostgreSQL instances. | effective_cache_size={DBInstanceClassMemory/16384} |
Operators |
| |
Functions |
| max_parallel_workers={GREATEST(DBInstanceClassCPU*3/4, 8)} |
References
For more information about PostgreSQL parameters, see Server Configuration.
For more information about how to modify parameters by using API operations, see the following table.
Operation
Description
Modifies the parameters of an instance.
Queries the parameter template of an instance.
Queries the parameter settings of an instance.