I have one master and four slaves. Sometimes all my slaves lag behind the master. I have implemented the heartbeat
for monitoring replication lag. Now I am trying to find why the slaves are lagging behind the master.
I saw the slow queries (for today) on the master and I found that the slowest query (DML) was taking 138 seconds. But the slaves were lagging about 1400 seconds and there were also no slow queries on the slaves for DML (update, delete, insert, etc.).
Points to be taken into consideration:
- All tables are InnoDB.
- 68 GB of RAM (Master as well as slaves).
- Data size about 1 TB.
- Master and slave are running from a long.
What may be the reason for lag?