MySQL is too many optimizations from the library behind the main library

Source: Internet
Author: User

Sometimes in order to avoid master.info and relay log crashes, the cost of tolerating extra Fsync () is recommended to set
Sync_master_info = 1
Sync_relay_log = 1
Sync_relay_log_info = 1

Of course, if the standby and the main library latency is particularly large, the standby IO thread thanks a lot of relay logs, through the Relay_log_purge setting, the SQL thread replay the events in a trunk log after the event will be deleted as soon as possible.
In extreme cases, you need to set relay_log_space_limit so that if the size of the trunk log exceeds this value, the I/O thread will stop waiting for the SQL thread to free up disk space.

Sync_master_info: How many transactions are refreshed Master.info per interval, and if the table (InnoDB) setting is not valid, each transaction will be updated
The effects of this variable in a replication slave depend on whether the slave ' s master_info_repository are set to FILE or TABLE
Sync_relay_log: The default is 10000, which means that sync_relay_log events are flushed to disk every 10,000 times. 0 means no refresh and is left to the OS cache control
If the value of this variable are greater than 0, the MySQL server synchronizes its relay logs to disk (using Fdatasync ()) a fter every Sync_relay_log events is written to the relay log. Setting This variable takes effect for all replication channels immediately, including running channels
Sync_relay_log_info: How many transactions are refreshed Relay-log.info per interval, and if the table (InnoDB) setting is not valid, each transaction will be updated
Master_info_repository: Record the information of the main library binlog, you can set file (master.info) or table (Mysql.slave_master_info)
Relay_log_info_repository: Log The information of the repository Relaylog, you can set file (relay-log.info) or table (Mysql.slave_relay_log_info)

In order to quickly synchronize the latest data from the library with the main library, you can temporarily modify the following configurations:

Innodb_flush_log_at_trx_commit = 0

Sync_binlog = 0

Sync_master_info = 2000
Sync_relay_log = 2000
Sync_relay_log_info = 2000

MySQL is too many optimizations from the library behind the main library

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.