How do I resolve master-slave replication delays?

Source: Internet
Author: User

MySQL master-slave replication is done by monitoring and synchronizing the host's Binlog logs, and then implementing the recovery, with many reasons for delays between master and slave:

1 is to monitor Binlog log files from the server, such as updates every 1 seconds,

2 is a SQL execution from the server is too long, some SQL to make a lock table;

3 is the primary server transaction is too large, assuming that 1 large transactions have been performed on the primary server for 1 minutes, then the last commit time is required to be transferred to the slave server. The master-slave delay time is at least 1 minutes, and if it takes 1 minutes to execute from the server, the worst case of a master-slave replication delay may be 2 minutes.

4 is a large number of SQL heaps on the primary server.

Workaround:

1, if the real-time requirements of the system, from the server only backup use, the data from the cache back, reduce the primary server pressure.

2, the use of physical replication.

3, the main server's large transaction operations, cut into a number of small transactions

How do I resolve master-slave replication delays?

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.