Updated on 2024-10-14 GMT+08:00

Creating a Parameter Template

You can use database parameter templates to manage the DB engine configuration. A database parameter template acts as a container for engine configuration values that can be applied to one or more DB instances.

If you create a DB instance without specifying a custom DB parameter template, a default parameter template is used. This default template contains DB engine defaults and system defaults that are configured based on the engine, compute class, and allocated storage of the instance. Default parameter templates cannot be modified, but you can create your own parameter template to change parameter settings.

Not all of the DB engine parameters in a custom parameter template can be changed.

If you want to use a custom parameter template, you simply create a parameter template and select it when you create a DB instance or apply it to an existing DB instance following the instructions provided in Applying a Parameter Template.

When you have already created a parameter template and want to include most of the custom parameters and values from that template in a new parameter template, you can replicate that parameter template following the instructions provided in Replicating a Parameter Template.

The following are the key points you should know when using parameters in a parameter template:

  • When you change a parameter value in a parameter template that has been applied to a DB instance and save the change, the change takes effect only to the DB instance and does not affect other DB instances.
  • The changes to parameter values in a custom parameter template take effect only after you apply the template to DB instances. For details, see Applying a Parameter Template.
  • When you change dynamic parameter values in parameter templates in batches and save the changes, the changes will take effect only after you apply the parameter templates to DB instances. When you change static parameter values in parameter templates in batches and save the changes, the changes will take effect for DB instances only after you apply the parameter templates to DB instances and manually reboot the DB instances.
  • Improper parameter settings may have unintended consequences, including reduced performance and system instability. Exercise caution when modifying database parameters and you need to back up data before modifying parameters in a parameter template. Before applying parameter template changes to a production DB instance, you should try out these changes on a test DB instance.

RDS does not share parameter template quotas with DDS.

You can create a maximum of 100 parameter templates for RDS DB instances. All RDS DB engines share the parameter template quota.

Differences Between Standard and High-Performance Parameter Templates

Only RDS for MySQL 5.7 and 8.0 support high-performance parameter templates. Compared with standard parameter templates, high-performance templates provide higher read/write speed but lower data security. The parameter comparisons are as follows:

Table 1 Differences between standard and high-performance parameter templates for MySQL 5.7

Parameter

Description

Recommended Value in a High-Performance Template

Recommended Value in a Standard Template

sync_binlog

This parameter is used to control how often the MySQL server synchronizes the binlogs to disk. If the default value is used, the binlogs are synchronized to disk each time a transaction is committed. If it is set to 0, the MySQL server relies on the operating system to flush the binlogs to disk from time to time as it does for any other file. This setting provides the best performance but lowest security. If it is set to N, the binlogs are synchronized to disk after N transactions are committed.

This parameter has been adjusted in high-performance parameter templates. If you use a high-performance parameter template for your DB instance, data may be lost after your instance is recovered from a crash and replication exceptions may occur.

1000

1

binlog_cache_size

This parameter specifies the size of the binlog cache. If write operations are frequent, increasing the value of this parameter can improve performance.

After this parameter is adjusted, out of memory risks increase in high-concurrency scenarios, especially for instances with small specifications.

2097152

32768

innodb_flush_log_at_trx_commit

Setting this parameter to 0 improves write performance in low-concurrency scenarios.

Adjusting this parameter may cause one second of data to be lost in extreme scenarios.

2

1

Table 2 Differences between standard and high-performance parameter templates for MySQL 8.0

Parameter

Description

Recommended Value in a High-Performance Template

Recommended Value in a Standard Template

transaction_isolation

This parameter specifies the default transaction isolation level.

A high-performance template uses the READ COMMITTED level. Compared with REPEATABLE READ, this level reduces row lock conflicts and does not have gap locks. This isolation level can prevent dirty reads, but phantom reads and non-repeatable reads may still occur.

READ-COMMITTED

REPEATABLE-READ

sync_binlog

This parameter is used to control how often the MySQL server synchronizes the binlogs to disk. If the default value is used, the binlogs are synchronized to disk each time a transaction is committed. If it is set to 0, the MySQL server relies on the operating system to flush the binlogs to disk from time to time as it does for any other file. This setting provides the best performance but lowest security. If it is set to N, the binlogs are synchronized to disk after N transactions are committed.

This parameter has been adjusted in high-performance parameter templates. If you use a high-performance parameter template for your DB instance, data may be lost after your instance is recovered from a crash and replication exceptions may occur.

1000

1

binlog_cache_size

This parameter specifies the size of the binlog cache. If write operations are frequent, increasing the value of this parameter can improve performance.

After this parameter is adjusted, out of memory risks increase in high-concurrency scenarios, especially for instances with small specifications.

2097152

32768

innodb_flush_log_at_trx_commit

Setting this parameter to 0 improves write performance in low-concurrency scenarios.

Adjusting this parameter may cause one second of data to be lost in extreme scenarios.

2

1

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Parameter Templates page, click Create Parameter Template.
  5. In the displayed dialog box, configure required information and click OK.

    • Select a DB engine for the parameter template.
    • The template name must consist of 1 to 64 characters. It can contain only uppercase letters, lowercase letters, digits, hyphens (-), underscores (_), and periods (.).
    • The description consists of a maximum of 256 characters and cannot contain carriage return characters or the following special characters: >!<"&'=
      Figure 1 Creating a parameter template