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, you need to log on to the ApsaraDB RDS console, go to the Editable 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 Editable Parameters tab of the Parameters page in the ApsaraDB RDS console.
Modify parameters
- 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.
In the left-side navigation pane, click Parameters.
On the Editable 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
- 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.
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 | The following parameters support expressions: work_mem , and maintenance_work_mem , and autovacuum_work_mem , and max_parallel_workers , and max_parallel_workers_per_gather , and effective_cache_size , and autovacuum_max_workers , and max_wal_size , and min_wal_size , and temp_file_limit , and wal_buffers , and max_parallel_maintenance_workers . 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.