The reason for the data delay of mysql replication slave server and the inherent cause of the solution delay is that the master server has two threads from the server, but it can only be executed in a single thread sequence, and there are also network latency and other reasons. Cause of delay: the master server can execute in parallel with multiple threads, but the slave server cannot execute in parallel because two processes need to depend on each other. Long execution query due to inefficient join operations. Hard Disk I/O bottleneck. Data lock. InnoDB concurrent threads. Solution to latency: www.2cto.com 1. effectively organize your data: Data normalization and data partitioning. 2. Divide and conquer each Breakthrough: there are enough slave; when all slave lag (latency) occurs, replication filtering and intermediary slave are required. 3. Find the long-running query and perform the following queries: simplify queries or use transactions instead. When using transactions, consider data loss caused by slave execution. 4. Server Load balancer. 5. Keep the hardware updated. 6. Reduce lock contention: MyISAM lock table and InnoDB row-level Lock. Author: Orange