Mongo replication lag slowly increasing

Posted on

Question :

I am running a replica-set in production with slaveOk = false using mongo 2.0.7 in AWS The replication lag on one of the servers is close to 58 hours. This replication lag is sometimes decreasing ( at very slow rate ) and sometimes increasing, but overall its lag is increasing 1-2 hours per day.

  • I restarted the server, but seeing no benefit
  • The read rate is 10 times of the read rate, compared to the other secondaries.
  • I checked the logs, but nothing weird
  • The lock % is very high ( close to 100% ) only on that server( and there is no such issues with the capped collection ). Other secondaries hardly have 10-20 lock%

One more weird thing that I noted about this server ( secondary ) is that mms is showing the version to be 2.2.1 and type as ‘standalone’ server, which is not the case ( cross checked using db.version() and rs.status() command )

Answer :

Firtsly, I hope you have set the indexes. At the other hand, If you don’t use db.repairDatabase() try it when you’re in maintanance mode. That command will re-indexing and doing many performance procedures.

If you want to more details; repairDatabase()

Leave a Reply

Your email address will not be published. Required fields are marked *