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?