Answer the question
In order to leave comments, you need to log in
Why is only one of the mongo replicaset nodes running fast?
Good day!
What is available: several DCs in different cities (or rather, countries) with ~ 100 ms ping between themselves. MongoDB on them, with a raised ReplicaSet. An application is deployed on each of the nodes with the settings setReadPref("nearest", {"dc":<nearest DC tag>}). There is an arbitrator in the replicaset.
The essence of the problem: requests for one of the nodes (geographically closest to me) are fast (a request of the find({_id: ...}) type), for all the others - slowly.
The average execution speed is about 500 ms for a 150 kb collection.
On a "fast" node, the request is completed in 0.01 ms.
If, on a "slow" node, the elements of the collection are limited, for example, to request only one field with an integer, the request is processed quickly.
In the millis = 0 profiler, locks on r / w are not more than 500 micros.
Answer the question
In order to leave comments, you need to log in
Are requests being processed for a long time on an already established connection?
Or before the connection is established.
With a ping of 100ms, it will take 200-300ms before sending a request to the server.
Look at the ReplicaSet data overload logs by node, and you will see a real delay that will be more than 100ms.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question