- What's New
- Function Overview
- Product Bulletin
- Service Overview
- Billing
-
Getting Started
- Getting Started with RDS for MySQL
- Getting Started with RDS for MariaDB
- Getting Started with RDS for PostgreSQL
- Change History
- Huawei Cloud MySQL Kernel
-
User Guide
-
Working with RDS for MySQL
- Suggestions on Using RDS for MySQL
- Database Migration
- Performance Tuning
- Instance Lifecycle
-
Instance Modifications
- Upgrading a Minor Version
- Changing a DB Instance Name
- Changing a DB Instance Description
- Changing the Replication Mode
- Changing the Failover Priority
- Changing a DB Instance Class
- Scaling Up Storage Space
- Configuring Storage Autoscaling
- Changing the Maintenance Window
- Changing a DB Instance Type from Single to Primary/Standby
- Promoting a Read Replica to Primary
- Manually Switching Between Primary and Standby DB Instances
- Changing the AZ of a Standby DB Instance
- Read Replicas
- Data Backups
- Data Restorations
-
Parameter Templates
- Creating a Parameter Template
- Modifying Parameters of an RDS for MySQL Instance
- Exporting a Parameter Template
- Comparing Parameter Templates
- Viewing Parameter Change History
- Replicating a Parameter Template
- Resetting a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying a Parameter Template Description
- Deleting a Parameter Template
- Connection Management
-
Database Proxy (Read/Write Splitting)
- Introducing Read/Write Splitting
- Suggestions on Using Database Proxy
- Kernel Versions
- Best Practices for Database Proxy
- Enabling Read/Write Splitting
- Configuring Transaction Splitting
- Configuring Connection Pools
- Configuring Multi-Statement Processing Modes
- Changing a Proxy from Pay-per-Use to Yearly/Monthly
- Configuring the Delay Threshold and Routing Policy
- Changing the Read/Write Splitting Address
- Changing the Read/Write Splitting Port
- Changing the Instance Class of a DB Proxy Instance
- Changing the Number of Proxy Nodes
- Upgrading the Kernel Version of Database Proxy
- Enabling or Disabling Access Control
- Restarting a Database Proxy
- Modifying Read/Write Splitting Parameters
- Disabling Read/Write Splitting
- Testing Read/Write Splitting Performance
- Database Management
- Account Management (Non-Administrator)
- Account and Network Security
- Metrics
- Interconnection with CTS
- Log Management
- Task Center
- Billing Management
- Managing Tags
-
Working with RDS for MariaDB
- Suggestions on Using RDS for MariaDB
- Instance Connection
- Parameter Tuning
- Instance Lifecycle
- Instance Modifications
- Read Replicas
- Data Backups
- Data Restorations
-
Parameter Templates
- Creating a Parameter Template
- Modifying RDS for MariaDB Instance Parameters
- Exporting a Parameter Template
- Importing a Parameter Template
- Comparing Parameter Templates
- Viewing Parameter Change History
- Replicating a Parameter Template
- Resetting a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying a Parameter Template Description
- Deleting a Parameter Template
- Connection Management
- Database Management
- Account Management (Non-Administrator)
- Account and Network Security
- Metrics
- Interconnection with CTS
- Log Management
- Task Center
- Managing Tags
-
Working with RDS for PostgreSQL
- Suggestions on Using RDS for PostgreSQL
- Database Migration
- Performance Tuning
- Instance Lifecycle
-
Instance Modifications
- Upgrading a Minor Version
- Changing a DB Instance Name
- Changing a DB Instance Description
- Changing the Replication Mode
- Changing the Failover Priority
- Changing a DB Instance Class
- Scaling Storage Space
- Changing the Maintenance Window
- Changing a DB Instance Type from Single to Primary/Standby
- Manually Switching Between Primary and Standby DB Instances
- Changing the AZ of a Standby DB Instance
- Read Replicas
- Data Backups
- Data Restorations
-
Parameter Templates
- Creating a Parameter Template
- Modifying Parameters of an RDS for PostgreSQL Instance
- Exporting a Parameter Template
- Comparing Parameter Templates
- Viewing Parameter Change History
- Replicating a Parameter Template
- Resetting a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying a Parameter Template Description
- Deleting a Parameter Template
- Connection Management
- Extension Management
- Tablespace Management
- Account and Network Security
- Metrics
- Interconnection with CTS
- Log Management
- Task Center
- Billing Management
- Major Version Upgrade
- Managing Tags
-
Working with RDS for MySQL
- Best Practices
- Performance White Paper
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- API v3.1 (Recommended)
-
API v3 (Recommended)
- Querying Version Information About APIs
- Querying Version Information About a DB Engine
- Querying Database Specifications
- Querying the Storage Type of a Database
-
DB Instance Management
- Creating a DB Instance
- Stopping an Instance
- Changing a DB Instance Name
- Changing the Description of a DB Instance
- Changing DB Instance Specifications
- Scaling Up Storage Space of a DB Instance
- Changing a Single DB Instance to Primary/Standby DB Instances
- Rebooting a DB Instance
- Deleting a DB Instance
- Querying DB Instances
- Binding and Unbinding an EIP
- Changing the Failover Priority
- Manually Switching Primary/Standby DB Instances
- Changing the Data Replication Mode of Primary/Standby DB Instances
- Configuring the Maintenance Window
- Database Security
- Backup and Restoration
- Log Information Queries
-
Database and Account Management (MySQL)
- Creating a Database
- Querying Details About a Database
- Querying Databases
- Querying Authorized Databases of a Specified User
- Deleting a Database
- Creating a Database Account
- Querying Database Users
- Querying Authorized Users of a Specified Database
- Deleting a Database Account
- Configuring a Password for a Database Account
- Authorizing a Database Account
- Revoking Permissions of a Database Account
- Resetting the Password for User root
- Database and Account Management (PostgreSQL)
-
Parameter Management
- Obtaining a Parameter Template List
- Creating a Parameter Template
- Modifying a Parameter Template
- Applying a Parameter Template
- Modifying Parameters of a Specified DB Instance
- Obtaining the Parameter Template of a Specified DB Instance
- Obtaining Parameters in a Specified Parameter Template
- Deleting a Parameter Template
- Recycling a DB Instance
- Tag Management
- Obtaining Task Information
- Appendix
- Change History
- SDK Reference
-
FAQs
- Product Consulting
- Resource and Disk Management
-
Database Connection
- What Should I Do If I Can't Connect to My RDS DB Instance?
- Can an External Server Access the RDS Database?
- What Do I Do If the Number of RDS Database Connections Reaches the Upper Limit?
- What Is the Maximum Number of Connections to an RDS DB Instance?
- How Can I Create and Connect to an ECS?
- What Should I Do If an ECS Cannot Connect to an RDS DB Instance Through a Private Network?
- What Should I Do If a Database Client Problem Causes a Connection Failure?
- What Should I Do If an RDS Database Problem Causes a Connection Failure?
- How Do My Applications Access an RDS DB Instance in a VPC?
- Do Applications Need to Support Reconnecting to the RDS DB Instance Automatically?
- Why Cannot I Ping My EIP After It Is Bound to a DB Instance?
- How Can I Obtain the IP Address of an Application?
- Can I Access an RDS DB Instance Over an Intranet Connection Across Regions?
- Is an SSL Connection to a DB Instance Interrupted After a Primary/Standby Switchover or Failover?
- Database Migration
- Database Permission
- Database Storage
- Client Installation
- Backup and Restoration
- Database Monitoring
- Capacity Expansion and Specification Change
- Database Parameter Modification
- Network Security
- Change History
- Troubleshooting
- Videos
Description of innodb_flush_log_at_trx_commit and sync_binlog
The innodb_flush_log_at_trx_commit and sync_binlog are key parameters for controlling the disk write policy and data security of RDS for MySQL. Different parameter values have different impacts on performance and security.
Parameter |
Allowed Values |
Description |
---|---|---|
innodb_flush_log_at_trx_commit |
0, 1, and 2 |
Controls the balance between strict ACID compliance for commit operations, and higher performance that is possible when commit-related I/O operations are rearranged and done in batches. The default value is 1. For details, see Parameter Description. |
sync_binlog |
0 to 4, 294, 967, 295 |
Sync binlog (RDS for MySQL flushes binary logs to disks or relies on the OS). |
Parameter Description
- innodb_flush_log_at_trx_commit:
- 0: The log buffer is written out to the log file once per second and the flush to disk operation is performed on the log file, but nothing is done at a transaction commit.
- 1: The log buffer is written out to the log file at each transaction commit and the flush to disk operation is performed on the log file.
- 2: The log buffer is written out to the file at each commit, but the flush to disk operation is not performed on it. However, the flushing on the log file takes place once per second.
NOTE:- A value of 0 is the fastest choice but less secure. Any mysqld process crash can erase the last second of transactions.
- A value of 1 is the safest choice because in the event of a crash you lose at most one statement or transaction from the binary log. However, it is also the slowest choice.
- A value of 2 is faster and more secure than 0. Only an operating system crash or a power outage can erase the last second of transactions.
- sync_binlog=1 or N
By default, the binary log is not every time synchronized to disk. In the event of a crash, the last statement in the binary log may get lost.
To prevent this issue, you can use the sync_binlog global variable (1 is the safest value, but also the slowest) to synchronize the binary log to disk after N binary log commit groups.
Recommended Configurations
innodb_flush_log_at_trx_commit |
sync_binlog |
Description |
---|---|---|
1 |
1 |
High data security and strong disk write capability |
1 |
0 |
High data security and insufficient disk write capability. Standby lagging behind or no replication is allowed. |
2 |
0/N (0 < N < 100) |
Low data security. A small amount of transaction log loss and replication delay is allowed. |
0 |
0 |
Limited disk write capability. No replication or long replication delay is allowed. |
- When both innodb_flush_log_at_trx_commit and sync_binlog are set to 1, the security is the highest but the write performance is the lowest. In the event of a crash you lose at most one statement or transaction from the binary log. This is also the slowest choice due to the increased number of disk writes.
- When sync_binlog is set to N (N > 1) and innodb_flush_log_at_trx_commit is set to 2, the RDS for MySQL write operation achieves the optimal performance.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.