This topic describes how to modify parameters of an ApsaraDB RDS for PostgreSQL instance to optimize performance or meet your business requirements. You can also view the parameter modification history.
Usage notes
-
Modifying some parameters triggers an instance restart. The instance restarts immediately after you modify the parameters and click Apply Parameters. To check whether modifying a parameter triggers a restart, view the Force Restart column on the Modifiable Parameters tab. If the instance restarts, your application is disconnected. Make sure your business can tolerate the restart before you proceed.
-
When you modify a parameter in the console, refer to the Valid Values column on the Modifiable Parameters tab for allowed values.
-
When you modify the following parameters on the primary instance, the changes are synchronized to all associated read-only instances.
wal_level, max_replication_slots, max_wal_senders, max_locks_per_transaction, max_worker_processes, max_prepared_transactions -
When you modify a parameter, the system attempts to apply the change. If the new value is invalid or causes the instance to fail, the modification is rolled back and the result is marked as Failed. You can view the result in the Status column on the Edit History tab.
-
The
log_statementparameter cannot be modified directly. To change this parameter, enable or disable SQL Explorer and Audit.
Modify parameter values
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 navigation pane, click Parameters.
-
On the Modifiable Parameters tab, find the parameter that you want to modify. You can modify parameters individually or in batches:
-
Modify a single parameter
-
Click the
icon next to the parameter that you want to modify. -
Enter the new value and click OK.
-
Click Apply Parameters.
-
In the dialog box, select when the new value takes effect: Take Effect Immediately, Take Effect Within the Maintenance Window (02:00-06:00), or Take Effect at Specified Time. Then, click OK.
-
-
Modify parameters in batches
-
Click Export Parameters to download the parameter file to your computer.
-
Open the parameter file and modify the parameter values.
-
Click Import Parameters.
-
In the Import Parameters dialog box, paste the parameters and their new values, and then click OK.
-
Confirm the modifications in the parameter list and click Apply Parameters.
-
In the dialog box, select when the new values take effect: Take Effect Immediately, Take Effect Within the Maintenance Window (02:00-06:00), or Take Effect at Specified Time, and then click OK.
-
NoteOn the Scheduled Tasks tab, you can view parameter modification tasks scheduled for Take Effect Within the Maintenance Window (02:00-06:00) or Take Effect at Specified Time.
-
Query parameter modification 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 navigation pane, click Parameters.
-
Click the Edit History tab.
-
Select a time range and click OK.
Parameter expressions
You can use expressions to set parameters. When you set an instance type-related parameter to an expression, the parameter value automatically adjusts when you change the instance type. This ensures the parameter value remains optimal for the new instance type.
The following table describes the supported expression syntax.
|
Category |
Usage notes |
Example |
|
Parameters |
The following parameters support expressions: Note
The max_parallel_maintenance_workers parameter is supported only for RDS PostgreSQL 11.0 and later. |
effective_cache_size |
|
Variables |
Note
For more information about the instance types and the storage capacity, memory size, number of CPU cores, and maximum number of connections that are supported by each instance type, see Primary RDS for PostgreSQL instance types. |
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 in the PostgreSQL documentation.
-
To modify parameters by calling API operations, see the following APIs:
API
Description
Modifies the parameters of an RDS instance.
Queries the parameter template of a database.
Queries the current parameter settings of an instance.
FAQ
How do I change the maximum number of connections for an RDS for PostgreSQL instance?
The maximum number of connections for an RDS for PostgreSQL instance is determined by the instance type and cannot be manually changed. To increase it, upgrade to a larger instance type. The maximum connections can differ between primary and read-only instances. For more information, see Primary instance types and Read-only instance types.