This topic describes how to manage the parameters of an ApsaraDB for RDS instance by using a parameter template. ApsaraDB RDS for MySQL instances provide system parameter templates and custom parameter templates.

Prerequisites

Instances must run one of the following MySQL versions:
  • MySQL 8.0
  • MySQL 5.7
  • MySQL 5.6

Background information

To ensure service availability, you can only configure certain parameters from the ApsaraDB RDS for MySQL console. ApsaraDB RDS for MySQL provides various system parameter templates and allows you to customize parameter templates to suit your business requirements in high-performance and other scenarios.
Note For more information about how to configure a single parameter, see Reconfigure parameters for an RDS MySQL instance.

System template introduction

Note System templates are only provided for MySQL High-availability instances based on local SSDs. For AsparaDB RDS for MySQL instances of other editions, you can Create a custom parameter template.

ApsaraDB RDS for MySQL High-availability instances based on local SSDs can use the following system parameter templates:

  • Default parameter template

    It ensures the highest data security but costs more time. Data is semi-synchronously replicated. The parameters are specified with the following values to protect data:

    • InnoDB
      • innodb_flush_log_at_trx_commit = 1
      • sync_binlog = 1
    • X-Engine (only the default parameter template is provided)

      sync_binlog = 1

  • Asynchronous parameter template

    It ensures high data security and fast speed. Data is asynchronously replicated. The parameters are specified with the following values to protect data:

    • innodb_flush_log_at_trx_commit = 1
    • sync_binlog = 1
  • High-performance parameter template

    It ensures common data security but costs less time. Data is asynchronously replicated. The parameters are specified with the following values to protect data:

    • innodb_flush_log_at_trx_commit = 2
    • sync_binlog = 1000
Note You cannot modify parameters in the system parameter templates by using a custom parameter template.

The following table describes the parameters in the system parameter templates:

Parameter Value Description
innodb_flush_log_at_trx_commit 1 When you submit a transaction, the system writes the transaction log from the buffer to the log file and synchronizes the log file to the disk immediately.
2 When you submit a transaction, the system writes the transaction log from the buffer to the log file but does not synchronize the log file to the disk immediately. The log file is written to the disk every second. If the system stops responding before a write operation is performed, logs generated within the last second will be lost.
sync_binlog 1 When you submit a transaction, the binary log file is written to the disk and the disk is immediately refreshed. The log file is not written to the buffer.
1000 The buffer is written to the disk and the disk is refreshed whenever 1,000 records are submitted to the buffer. This may result in data loss.

Apply a parameter template

  1. Log on to the ApsaraDB for RDS console.
  2. In the upper-left corner of the page, select the region where the target RDS instance resides.
    Select a region
  3. In the left-side navigation pane, select Parameter Templates.
    View the parameter template list
  4. In the Custom Parameter Templates or System Parameter Templates tab, find the template that you want to apply.
  5. Click Apply to Instance in the Actions column.
  6. Select RDS instances from the All Instances section, click to move them to the Selected Instances section, and check the parameter comparison.
    Note Before you apply a parameter template to multiple RDS instances, you must verify that the parameters are suitable for the RDS instances.
  7. Click OK.

Create a custom parameter template

  1. Log on to the ApsaraDB for RDS console.
  2. In the upper-left corner of the page, select the region where the target RDS instance resides.
    Select a region
  3. In the left-side navigation pane, click Parameter Templates. In the upper-right corner, click Create Parameter Template.
    Create a parameter template
  4. Configure the following parameters.
    Parameter Description
    Template Name Enter the name of the parameter template. The name must be 8 to 64 characters in length and can contain letters, digits, periods (.), and underscores (_). It must start with a letter.
    Database Engine Set the value to MySQL.
    Engine Version Valid values: MySQL 5.6, 5.7, and 8.0.
    Description Enter a description that helps identify the parameter template. The description can be up to 200 characters in length.
    Add Parameter Click Add Parameter and select a parameter from the Parameter drop-down list. Then, you can set the parameter value as well as view the value range and default value.
    Note
    • For more information about available parameters, see Editable Parameters on the Parameters page.
    • If you want to add another parameter, you must click Add Parameter again.
    • If you want to remove a parameter, you must click Delete to the right of the parameter.
    Add a parameter
    Import If you have exported a parameter template to your computer, you can edit that template based on your business needs and then click Import to copy its parameters. For more information about how to export a parameter template, see Reconfigure parameters for an RDS MySQL instance.
  5. Click Confirm.

Clone a parameter template

You can clone a parameter template from the current region to another region.

  1. Log on to the ApsaraDB for RDS console.
  2. In the upper-left corner of the page, select the region where the target RDS instance resides.
    Select a region
  3. In the left-side navigation pane, select Parameter Templates.
    View the parameter template list
  4. Find the target parameter template, and click Clone in the Actions column.
  5. Configure the following parameters.
    Parameter Description
    Region Select the destination region to which you want to clone the parameter template.
    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 Enter a description that helps identify the parameter template. The description can be up to 200 characters in length.
  6. Click OK.

Manage parameter templates

  1. Log on to the ApsaraDB for RDS console.
  2. In the upper-left corner of the page, select the region where the target RDS instance resides.
    Select a region
  3. In the left-side navigation pane, click Parameter Templates.
    View the parameter template list
  4. Manage parameter templates in this region.
    Note You can only perform the View and Apply to Instance operations on system templates.
    To view a parameter template, follow these steps:

    Find the target parameter template, and click View in the Actions column. On the page that appears, view the basic information and parameters of the template.

    View a parameter template
    To modify a parameter template, follow these steps:
    1. Find the target parameter template, and click Edit in the Actions column. For more information, see Step 4 in the "Create a parameter template" section.
    2. Click Edit.
    To delete a parameter template, follow these steps:

    Find the target parameter template, and click Delete. In the message that appears, click OK.

    Note Deleting a parameter template will not affect the RDS instances to which the template was applied.

Related operations

Operation Description
CreateParameterGroup Creates an ApsaraDB for RDS parameter template.
ModifyParameterGroup Modifies an ApsaraDB for RDS parameter template.
CloneParameterGroup Clones an ApsaraDB for RDS parameter template from one region to another.
DescribeParameterGroups Queries the ApsaraDB for RDS parameter templates available to a region.
DescribeParameterGroup Queries an ApsaraDB for RDS parameter template.
DeleteParameterGroup Deletes an ApsaraDB for RDS parameter template.