This topic describes how to view and reconfigure the parameters of an ApsaraDB RDS for MySQL instance by using the ApsaraDB RDS console or the ApsaraDB RDS API. You can also view the parameter reconfiguration history in the ApsaraDB RDS console.

Precautions

  • To ensure instance stability, you can reconfigure only the parameters that appear in the ApsaraDB RDS console.
  • When you reconfigure parameters, you can refer to the Value Range column on the Editable Parameters tab in the ApsaraDB RDS console.
  • The new values of some parameters can take effect only after an instance restart. For more information, refer to the Force Restart column on the Editable Parameters tab in the ApsaraDB RDS console. We recommend that you reconfigure parameters during off-peak hours and make sure that your application is configured to automatically reconnect to your RDS instance.

Reconfigure parameters

Note If you want to reconfigure a number of parameters at a time, we recommend that you use a parameter template. For more information, see Use a parameter template to manage parameters.
  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Parameters.
  3. Perform the following operations based on your business requirements:
    • Apply a parameter template to the RDS instance.
      Note If an instance restart is required, we recommend that you apply the parameter template during off-peak hours and make sure that your application is configured to automatically reconnect to the RDS instance.
      1. On the Editable Parameters tab, click Apply Template.
      2. In the Apply Template dialog box, select the parameter template and click OK.
        Note
        • You can view the number of parameters in the parameter template and check whether you must restart the RDS instance. For more information about the parameter reconfiguration history, click View Parameter Change.
        • If you cannot find the parameter template, check whether the parameter template belongs to the same region as the RDS instance. If they belong to different regions, you can copy the parameter template to the region to which the RDS instance belongs. For more information, see Use a parameter template to manage parameters.
        Apply Template
    • Export the parameter settings of the RDS instance as a parameter template in the current region.
      1. On the Editable Parameters tab, click Export as Template.
      2. Configure the following parameters: Export as Template
        Parameter Description
        Template Name Enter the name of the parameter template. The name must be 8 to 64 characters in length.It can contain letters, digits, periods (.), and underscores (_). It must start with a letter.
        Description The description that is used to identify the parameter template. The description can be up to 200 characters in length.
      3. Click OK.
    • Export the parameter settings of the PolarDB instance to your computer.

      On the Editable Parameters tab, click Export Parameters. The parameter settings of the RDS instance are exported as a TXT file to your computer.

      1. Reconfigure the parameters in the TXT file. Click Import Parameters. In the Import Parameters dialog box, paste the new parameter values that you have copied from the TXT file.
      2. Click OK.
      3. In the upper-right corner of the page, click Apply Changes.
        Note
        • If the new parameter value of a parameter takes effect only after an instance restart, ApsaraDB RDS prompts you to restart the RDS instance. We recommend that you restart the RDS instance during off-peak hours and make sure that your application is configured to automatically reconnect to the RDS instance.
        • Before the new values of the parameters are applied, you can click Cancel Changes to cancel the new values.
    • Reconfigure a single parameter of the RDS instance.
      1. On the Editable Parameters tab, find the parameter that you want to reconfigure, and click the Edit icon icon in the Actual Value column.
      2. Enter a new value based on the prompted value range. Parameter settings
      3. Click Confirm.
      4. In the upper-right corner of the page, click Apply Changes.
        Note
        • If the new value of the parameter takes effect only after an instance restart, the system prompts you to restart the RDS instance. We recommend that you restart the RDS instance during off-peak hours and make sure that your application is configured to automatically reconnect to the RDS instance.
        • Before the new value of the parameter is applied, you can click Cancel Changes to cancel the new value.

View the parameter reconfiguration history

  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Parameters.
  3. On the page that appears, click the Edit History tab.
  4. Select a time range and click Search.

Reconfigure parameters by using expressions

You can set a parameter to an expression for an RDS instance. If you set a parameter that is related to instance types to an expression, the value of the parameter dynamically changes when the instance type changes. This ensures the stability of the RDS instance.

For example, the innodb_buffer_pool_size parameter in the following figure is set to {DBInstanceClassMemory*3/4}. If the value of the DBInstanceClassMemory variable changes, you do not need to reconfigure the innodb_buffer_pool_size parameter because the value of the parameter dynamically changes.

Expression syntax

The following table describes the supported expression syntax.

Category Description Example
Variables
  • AllocatedStorage: indicates the storage capacity of an RDS instance. The value is an integer.
  • DBInstanceClassMemory: indicates the actual memory capacity of an RDS instance. The value is calculated by deducting the memory capacity that is occupied by the control processes on the instance from the memory capacity that is specified by the instance type. The value is an integer. For example, the memory capacity that is specified by the instance type is 16 GB, and the memory capacity that is occupied by the control processes is 4 GB. In this case, the value of the DBInstanceClassMemory variable is 12 GB.
  • DBInstanceClassCPU: indicates the number of CPU cores that are specified by the instance type. The value is an integer.
  • DBInstanceClassConnections: indicates the maximum number of connections that are supported by the instance type. The value is an integer.
Note
  • For more information about the instance types, and the storage capacity, memory capacity, number of CPU cores, and maximum number of connections allowed by each instance type, see Primary instance types.
  • For more information about how to configure the innodb_buffer_pool_size parameter for an RDS instance, see InnoDB buffer pool specifications.
  • The memory capacity occupied by control processes is determined by one of the two values whichever is smaller. One value is calculated based on the following formula: Memory capacity that is specified by the instance type × 0.65. The other value is calculated based on the following formula: (Memory capacity that is specified by the instance type/16384) + 1) × 2048.
{DBInstanceClassMemory*3/4}
Operators
  • Expression syntax: An expression is enclosed by a pair of braces ({}).
  • Division operator (/): A dividend is divided by a divisor. The quotient is an integer. If the quotient is a decimal, only the integer part is taken. The dividend and the divisor must be integers. For example, ApsaraDB RDS can process {DBInstanceClassMemory*3/4}, but not {DBInstanceClassMemory*0.75}.
  • Multiplication operator (*): A number multiplies another number. The product is an integer. If the product is a decimal, only the integer part is taken. The two numbers must be integers.
Functions
  • The GREATEST() function returns the largest value among an array of integers or the largest value calculated by an array of expressions.
  • The LEAST() function returns the smallest value among an array of integers or the smallest value calculated by an array of expressions.
  • The SUM() function adds a specific integer or the value calculated by a specific expression.
LEAST({DBInstanceClassMemory/256},10485760)

FAQ

  • After I reconfigure the parameters of my RDS instance, are the new values of the parameter immediately take effect? And do I must restart my RDS instance?

    Some parameters do not require an instance restart after they are reconfigured. The new values of these parameters take effect in about 5 minutes. Some parameters require an instance restart after they are reconfigured. For more information, refer to the Force Restart column on the Editable Parameters tab in the ApsaraDB for RDS console.

    The Force Restart column
  • After I reconfigure the parameters of my RDS instance, why do the new values of the parameters not take effect?

    After you reconfigure the parameters of your RDS instance, you must click Apply Changes in the upper-right corner of the Editable Parameters tab in the ApsaraDB RDS console. This makes the new values of the parameters take effect.

Related operations

API Description
Modify parameters of an ApsaraDB for RDS instance Reconfigures the parameters of an ApsaraDB RDS instance.
Query the parameter template of an ApsaraDB for RDS instance Queries the parameter templates that are available to an ApsaraDB RDS instance.
Query parameter configurations Queries the parameter settings of an ApsaraDB RDS instance.