I have a mongoDB database, with 1 primary and 1 secondary in replicaset(and 1 arbiter). Both the servers are hosted on aws on c4.2xlarge instances(with 1.5 TB of SSD on each). Mongo version of primary server is 3.4.9 and secondary is 3.4.10. This is the only difference between two instances(version diff).

The issue is whenever I start reading from the secondary server(i.e set READ PREDERENCE SECONDARY on my application), MongoDB starts working slow or inefficiently(queues start to increase in rabbitMQ and processes start taking time), and when I make my application to read-and-write both from primary only, it works perfectly.

What can be the issue or possible cause(with the given information)? Has anyone else too has faced the same or similar issue? I know this sounds random, or vague, but I am 100% sure, the issue is with reading from secondary. I will try to get some more logs for the same. But currently I have only this much information only.(And there no lag between two, in any case,whether reading from secondary or not)

Thanks in adavance.

  • What is the reason that you "need" to read from secondary? Too much load on the primary? Because it is not recommended to read from secondary, if it is not absolutely needed. – JJussi Dec 10 '17 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.