MySQL Dual 1 Setup

Source: Internet
Author: User
Innodb_flush_log_at_trx_commit and Sync_binlog two parameters are key parameters for controlling MySQL disk write policy and data security.

If Innodb_flush_log_at_trx_commit is set to 0,log buffer, it is written to log file once per second, and the flush (swipe to disk) operation of log file is performed concurrently.
In this mode, the operation to write to the disk is not actively triggered when the transaction commits.
If Innodb_flush_log_at_trx_commit is set to 1, MySQL writes log buffer data to log file each time the transaction commits, and flush (swipe to disk).
If Innodb_flush_log_at_trx_commit is set to 2, MySQL writes log buffer data to log file each time the transaction commits. But the flush (brushed to disk) operation does not work at the same time.
In this mode, MySQL executes the flush (swipe to disk) operation once per second.


Sync_binlog
The default value of Sync_binlog is 0, like the mechanism of the operating system brushing other files, MySQL does not sync to disk but relies on the operating system to flush binary logs.
When Sync_binlog =n (n>0), MySQL synchronizes its binary log binary logs to disk using the Fdatasync () function when it writes N binary log binary logs every nth time.

MySQL Dual 1 Setup

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.