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

Precautions

  • To ensure the stability of your RDS instance, you are allowed to reconfigure only the parameters that are displayed in the ApsaraDB RDS console.
  • When you reconfigure the parameters of your RDS instance, you can view the value range of each parameter in the Value Range column on the Editable Parameters tab of the Parameters page in the ApsaraDB RDS console.
  • The new values of some parameters take effect only after you restart your RDS instance. For more information, view the Force Restart column on the Editable Parameters tab of the Parameters page 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 multiple 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 the parameter template takes effect only after you restart the RDS instance, 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 to make the new values of the parameters take effect. You can also click View Parameter Change to view the value changes of the parameters in the parameter template.
        • If you cannot find the parameter template, you must check whether the parameter template belongs to the same region as the RDS instance. If the parameter template and the RDS instance belong to different regions, you can replicate 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 region that you select.
      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 lengthand can contain letters, digits, periods (.), and underscores (_). The name 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 RDS instance to your computer as a TXT file.

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

      1. Reconfigure the parameters in the TXT file. Click Import Parameters. In the Import Parameters dialog box, paste the new parameter values that you copied from the TXT file.
      2. Click OK.
      3. In the upper-right corner of the page, click Apply Changes.
        Note
        • If the new values of the reconfigured parameters take effect only after you restart the RDS instance, 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 reconfigured parameters are applied, you can click Cancel Changes to revoke 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 Running Parameter Value column.
      2. Enter a new value based on the value range that is displayed. Reconfigure a single parameter
      3. Click OK.
      4. In the upper-right corner of the page, click Apply Changes.
        Note
        • If the new value of the reconfigured parameter takes effect only after you restart the RDS instance, 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 reconfigured parameters are applied, you can click Cancel Changes to revoke the new values.

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

Reconfigure parameters by using expressions

You can set a parameter to an expression for an 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. This way, the stability of the RDS instance is ensured.

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 this parameter dynamically changes.

Expression syntax

The following table describes the supported expression syntax.

Category Description Example
Variables
  • AllocatedStorage: specifies the storage capacity of an RDS instance. The value of this variable is an integer.
  • DBInstanceClassMemory: specifies the available memory capacity of an RDS instance. The value of this variable is calculated by deducting the memory capacity that is occupied by the control processes on the instance from the memory capacity that is supported by the instance type. The value of this variable is an integer. For example, if the memory capacity that is supported by the instance type is 16 GB and the memory capacity that is occupied by the control processes is 4 GB, the value of the DBInstanceClassMemory variable is 12 GB.
  • DBInstanceClassCPU: specifies the number of cores that are supported by the instance type. The value of this variable is an integer.
  • DBInstanceClassConnections: specifies 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 allowed by each instance type, see Primary ApsaraDB RDS instance types.
  • For more information about how to set the innodb_buffer_pool_size parameter of an RDS instance, see Size of the InnoDB buffer pool.
  • The memory capacity that is occupied by control processes is the smaller value between the values that are calculated by using the following formulas: Memory capacity supported by the instance type × 0.65 and (Memory capacity supported by the instance type/16384) + 1) × 2048.
{DBInstanceClassMemory*3/4}
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, only the integer part of the quotient is returned. The dividend and the divisor must be integers. For example, ApsaraDB RDS can process {DBInstanceClassMemory*3/4} but not {DBInstanceClassMemory*0.75}.
  • Multiplication operator (*): This operator is used to multiply a number by another number. If the product is a decimal, only the integer part of the product is returned. The two numbers must be integers.
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 a specified integer or the value that is calculated by a specified expression.
LEAST({DBInstanceClassMemory/256},10485760)

FAQ

  • After I reconfigure the parameters of my RDS instance, do the new values of the parameters immediately take effect? Do I need to restart my RDS instance?

    After you reconfigure the parameters of your RDS instance, the new values of some parameters take effect in approximately 5 minutes even if you do not restart your RDS instance. However, some parameters require you to restart your RDS instance to make the new values take effect. For more information, view the Force Restart column on the Editable Parameters tab of the Parameters page in the ApsaraDB RDS console.

    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 on the Parameters page in the ApsaraDB RDS console to make the new values of the parameters take effect.

Related operations

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