To manage parameters for multiple instances in bulk, use parameter templates to quickly apply settings to your instances. Parameter templates are categorized into system parameter templates and custom parameter templates.
Prerequisites
Your instance must run one of the following MySQL versions:
MySQL 8.4
MySQL 8.0 (including serverless instances)
MySQL 5.7
MySQL 5.6
Background information
To ensure service availability, Alibaba Cloud restricts modifying certain critical parameters. To meet diverse business needs such as achieving higher performance, ApsaraDB RDS provides various system parameter templates. You can also create custom parameter templates to apply parameter settings in bulk based on your specific use cases.
If you only need to modify a parameter for a single instance, see Set instance parameters.
System parameter templates
System parameter templates are available only for instances that run RDS High-availability Edition and RDS Basic Edition. For instances that run RDS Enterprise Edition, you can create a custom parameter template.
The following system parameter templates are available for instances that run RDS High-availability Edition and RDS Basic Edition:
Default parameter template
This template offers the highest data security but has slower read and write performance. Data replication uses semi-synchronous mode. The following data protection parameters are used:
InnoDB engine
innodb_flush_log_at_trx_commit = 1sync_binlog = 1
X-Engine engine (Only the default parameter template is provided for this engine)
sync_binlog = 1
NoteWhen you create an instance, a default parameter template that matches the selected instance version and series is used by default. To view the parameter values of the default parameter template, log on to the ApsaraDB RDS console, click Parameter Templates in the left navigation bar, click the System Parameter Templates tab, and search for Default Parameter Template. You can then view the parameter values of all default parameter templates.
You cannot modify a default parameter template.
Asynchronous parameter template
This template provides high data security and faster performance. Data replication uses asynchronous mode. The following data protection parameters are used:
innodb_flush_log_at_trx_commit = 1sync_binlog=1rpl_semi_sync_master_enabled=off
NoteTo change the data replication mode to asynchronous, see Query and modify the data replication mode.
High-performance parameter template
This template provides moderate data security and the fastest read and write performance. Data replication uses asynchronous mode. The following data protection parameters are used:
innodb_flush_log_at_trx_commit = 2sync_binlog = 1000
You cannot use a custom parameter template to modify the parameters defined in a system parameter template.
The following table describes the parameters.
Parameter | Value | Description |
| 1 | When a transaction is committed, the system writes the transaction log from the buffer to the log file and flushes it to disk immediately. |
2 | When a transaction is committed, the transaction log is written from the buffer to the log file but not necessarily flushed to disk immediately. The log file is flushed to disk once per second. If the system crashes before the flush, the last second of transactions may be lost. | |
| 1 | After a transaction is committed, the binary log is written and flushed to disk immediately, bypassing the system cache. |
1000 | The system flushes the binary log to disk after every 1,000 write operations. This creates a risk of data loss if a crash occurs. |
Apply a parameter template
Log on to the ApsaraDB RDS console. In the left navigation bar, select Parameter Templates, and then select a region at the top.
On the Custom Parameter Templates or System Parameter Templates tab, find the template that you want to apply, and in the Actions column, click
> Apply to Instance.From the instance list on the left, select the target instances and click the
icon to move them to the right. Review the parameter changes.ImportantWhen you apply a parameter template to multiple instances, ensure that the parameters are suitable for all selected instances. Proceed with caution.
Click OK.
Create a custom parameter template
Log on to the ApsaraDB RDS console. In the left-side navigation pane, click Instances. In the top navigation bar, select the region in which the RDS instance resides.
In the left navigation bar, click Parameter Templates, and then on the Parameter Templates page on the right, click Create Parameter Template.
Configure the following parameters.
Parameter
Description
Template Name
The name must be 8 to 64 characters in length and can contain letters, digits, periods (.), and underscores (_). It must start with a letter and cannot contain Chinese characters.
Database Engine
This topic uses MySQL as an example. Select MySQL.
Engine Version
Supported versions: MySQL 5.6, 5.7, and 8.0.
Description
Enter a description for the template. The description can be up to 200 characters in length.
Add Parameter
Clicking Add Parameter adds a new parameter row, allowing you to select a Parameter, set a value, and view information such as the value range and default value.
NoteTo view the parameters that can be added or modified, go to the RDS Instances page, select a region at the top, and then click the ID of the target instance. In the left-side navigation pane, click Parameters, and view the parameters on the Editable Parameters tab.
To configure another parameter, click Add Parameter again.
To delete a parameter, click Delete to the right of the parameter.
Import
You can modify the exported template, click Import, and paste the parameters to generate the template. To export a template, see Set instance parameters.
Click Confirm.
Clone a custom parameter template
You can clone a custom parameter template to another region or create a copy within the same region to use as a basis for a new template.
Only custom parameter templates can be cloned. System parameter templates cannot be cloned.
Log on to the ApsaraDB RDS console. In the left-side navigation pane, click Instances. In the top navigation bar, select the region in which the RDS instance resides.
In the left navigation bar, click Parameter Templates.
To the right of the parameter template ID, in the Actions column, click .
Configure the following parameters.
Parameter
Description
Region
The destination region for the cloned template.
Template Name
The name must be 8 to 64 characters in length and can contain letters, digits, periods (.), and underscores (_). It must start with a letter and cannot contain Chinese characters.
Description
Enter a description for the template. The description can be up to 200 characters in length.
Click OK.
Manage parameter templates
Log on to the ApsaraDB RDS console. In the left-side navigation pane, click Instances. In the top navigation bar, select the region in which the RDS instance resides.
In the left navigation bar, click Parameter Templates.
You can manage parameter templates in the following ways:
NoteSystem templates only support View and Apply to Instance.
View a parameter template
Click the parameter template ID or click View in the Actions column of the parameter template to view its basic information and parameter information.
Modify a parameter template
ImportantIf you modify a custom parameter template, you must reapply it to your instances for the changes to take effect.
An instance restarts after the template is applied only if the template contains parameters that require a restart.
Click in the Actions column next to the parameter template ID, or click Edit Parameter Template at the top of the page while viewing a parameter template. For detailed parameter descriptions, see Parameter template descriptions.
Click Yes.
Delete a parameter template
NoteDeleting a parameter template does not affect instances that are already using it.
Click in the Actions column of the target parameter template, and in the dialog box that appears, click OK.
API reference
API | Description |
Creates an RDS parameter template. | |
Modifies an RDS parameter template. | |
Clones an RDS parameter template to the same region or another region. | |
Queries a list of parameter templates in a specific region. | |
Queries the details of a specific RDS parameter template. | |
Deletes an RDS parameter template. |
FAQ
Q: How do I reset a parameter in a custom parameter template to its default value?
A:
In the custom parameter template, find the target parameter and reset its value to the default. For instructions, see Modify a parameter template.
Reapply the parameter template to the target instance. For instructions, see Apply a parameter template.
> Clone