Parameter templates let you apply a consistent set of parameters to multiple ApsaraDB RDS for MySQL instances at once. RDS provides three built-in system parameter templates that balance data security against performance, and you can create custom templates for workloads with specific requirements.
To configure a single parameter on one instance, see Modify instance parameters.
Supported versions
Parameter templates are supported for instances running the following MySQL versions:
MySQL 8.0 (including serverless instances)
MySQL 5.7
MySQL 5.6
System parameter templates
System parameter templates are available for RDS High-availability Edition and RDS Basic Edition instances only. If your instance runs RDS Enterprise Edition, create a custom parameter template instead.
RDS provides three system parameter templates, each offering a different balance between data security and read/write performance:
| Template | Replication mode | Data security | Performance |
|---|---|---|---|
| Default parameter template | Semi-synchronous | Highest | Relatively slow |
| Asynchronous parameter template | Asynchronous | High | Fast |
| High-performance parameter template | Asynchronous | Average | Fastest |
Some parameters require an instance restart to take effect. When you apply or re-apply a parameter template that includes such parameters, your RDS instance may be restarted. If the modified parameters require an instance restart for the changes to take effect, you must restart your RDS instance.
Custom parameter templates cannot override the parameter values defined in system parameter templates.
Default parameter template
Selected automatically when you create an instance. This template cannot be modified.
Fixed parameters:
InnoDB:
innodb_flush_log_at_trx_commit = 1,sync_binlog = 1X-Engine:
sync_binlog = 1
To view the parameter settings of the default parameter template, log on to the ApsaraDB RDS console, click Parameter Templates in the left-side navigation pane, click the System Parameter Templates tab, and search for "default parameter template".
Asynchronous parameter template
Uses asynchronous replication for faster throughput while maintaining strong durability settings.
Fixed parameters: innodb_flush_log_at_trx_commit = 1, sync_binlog = 1, rpl_semi_sync_master_enabled = off
To change the data replication mode to asynchronous, see Query and change the data replication mode.
High-performance parameter template
Optimizes for the fastest read/write speed. Accepts a higher risk of data loss in the event of an unexpected shutdown.
Fixed parameters: innodb_flush_log_at_trx_commit = 2, sync_binlog = 1000
Parameter reference
| Parameter | Value | Behavior |
|---|---|---|
innodb_flush_log_at_trx_commit | 1 | On each commit, writes the transaction log from the buffer to the log file and immediately flushes to disk. |
innodb_flush_log_at_trx_commit | 2 | On each commit, writes the transaction log to the log file but does not flush to disk immediately. The log file is flushed to disk once per second. Logs from the most recent second may be lost if the system stops unexpectedly. |
sync_binlog | 1 | On each commit, writes the binary log to disk immediately without buffering. |
sync_binlog | 1000 | Flushes the binary log to disk once every 1,000 commits. May result in data loss. |
Apply a parameter template
Before applying a template to multiple instances, verify that the parameter settings are compatible with all target instances.
Log on to the ApsaraDB RDS console. In the left-side navigation pane, click Parameter Templates. In the top navigation bar, select the region where your instance resides.
On the Custom Parameter Templates or System Parameter Templates tab, find the template you want to apply, and choose
> Apply to Instances in the Actions column.In the All Instances section of the panel, select the instances to which you want to apply the template. Click the
icon to move them to the Selected Instances section, and then review the changes in the Parameter Comparison section.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 where your instance resides.
In the left-side navigation pane, click Parameter Templates. On the Parameter Templates page, click Create Parameter Template.
Configure the template settings.
To view available parameters for your instance, go to the Instances page, click the instance ID, click Parameters in the left-side navigation pane, and then view the Editable Parameters tab.
Parameter Description Template Name Enter a name for the template. The name must be 8–64 characters and can contain letters, digits, periods ( .), and underscores (_). The name must start with a letter.Database Engine Set to MySQL. Engine Version Select the MySQL engine version: 5.6, 5.7, or 8.0. Description (Optional) Enter a description of up to 200 characters. Add Parameter Click Add Parameter and select a parameter from the drop-down list. Enter the parameter value. To add another parameter, click Add Parameter again. To delete a parameter, click Delete to the right of the parameter. Import Import parameter settings from an exported template file. For information about how to export a template, see Modify instance parameters. Click OK.
Clone a parameter template
Use the clone feature to copy a custom parameter template to another region or to create a modified copy of an existing template. 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 where your instance resides.
In the left-side navigation pane, click Parameter Templates.
Find the template you want to clone, click the
icon, and then select Clone in the Actions column.Configure the clone settings.
Parameter Description Region Select the destination region for the cloned template. Template Name Enter a name for the cloned template. The name must be 8–64 characters and can contain letters, digits, periods ( .), and underscores (_). The name must start with a letter.Operation Enter a description of up to 200 characters. 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 where your instance resides.
In the left-side navigation pane, click Parameter Templates.
Manage your templates using the operations described below.
For system templates, only the View and Apply to Instance operations are available.
View a parameter template
Find the template and click View in the Actions column to see its basic information and parameter settings.
Modify a parameter template
After modifying a custom template, re-apply it to your RDS instances for the changes to take effect. After you re-apply the template, your RDS instance may be restarted. If the modified parameters require an instance restart for the changes to take effect, you must restart your RDS instance.
Find the template you want to modify. Click the
icon and then select Modify in the Actions column. Alternatively, click View in the Actions column, and then click Edit Parameter Template in the panel.Make your changes and click OK.
Reset parameters to default values
To reset a parameter value to its default in a custom template:
Find the parameter in your custom template and change its value back to the default. For default values, see Modify instance parameters.
Re-apply the custom template to your RDS instance. See Apply a parameter template.
Delete a parameter template
Deleting a template does not affect RDS instances that already have the template applied.
Find the template you want to delete, click the
icon, and then select Delete in the Actions column. In the confirmation dialog, click OK.
API reference
| Operation | Description |
|---|---|
| CreateParameterGroup | Creates a parameter template. |
| ModifyParameterGroup | Modifies a parameter template. |
| CloneParameterGroup | Clones a parameter template to another region. |
| DescribeParameterGroups | Queries parameter templates available in a region. |
| DescribeParameterGroup | Queries details of a parameter template. |
| DeleteParameterGroup | Deletes a parameter template from a region. |