All Products
Search
Document Center

ApsaraDB RDS:Modify the parameters of an ApsaraDB RDS for PostgreSQL instance

Last Updated:Jan 25, 2024

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

  1. 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.
  2. In the left-side navigation pane, click Parameters.

  3. 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.

      1. Find the parameter and click the icon in the Running Parameter Value column.

      2. Enter a new value and click OK.

      3. Click Apply Changes.

      4. In the dialog box that appears, click OK.

    • If you want to reconfigure multiple parameters at a time, perform the following steps:

      1. Click Export Parameters to download the parameter settings of your RDS instance as a file to your computer.

      2. Open the file and modify the parameters.

      3. Click Import Parameters.

      4. In the Import Parameters dialog box, paste the parameter settings that you have copied from the file. Then, click OK.

      5. Confirm the values of the modified parameters and click Apply Changes.

View the parameter configuration history

  1. 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.
  2. In the left-side navigation pane, click Parameters.

  3. Click the Edit History tab.

  4. 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

  • AllocatedStorage: the storage capacity that is supported by the instance type in MB. The value of this variable is an integer.

  • DBInstanceClassMemory: the memory capacity that is supported by the instance type in bytes. The value of this variable is an integer.

  • DBInstanceClassCPU: the number of cores that are supported by the instance type. The value of this variable is an integer.

  • DBInstanceClassConnections: the maximum number of connections that are supported by the instance type. The value of this variable is an integer.

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

  • Expression syntax: An expression is enclosed by a pair of braces {}.

  • Division operator (/): This operator is used to divide a number by another number. If the quotient is a decimal, the quotient is not rounded, and only the integer part is counted. The dividend and divisor can be decimals.

  • Multiplication operator (*): This operator is used to multiply a number by another number. If the product is a decimal, the product is not rounded, and only the integer part is counted. The multipliers can be decimals.

Functions

  • The GREATEST() function returns the largest value among an array of integers or the largest value that is calculated by an array of expressions.

  • The LEAST() function returns the smallest value among an array of integers or the smallest value that is calculated by an array of expressions.

  • The SUM() function adds integers or the values that are calculated by specified expressions.

max_parallel_workers={GREATEST(DBInstanceClassCPU*3/4, 8)}

References