Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Distributing Load among secondary & primary members in mongo replica set

$
0
0

I was looking for distributing my load to all members of Replica set in mongo and came across fact that based on preferences i can distribute read loads to secondary.

Question 1. what is the logic used by mongo drivers to distribute loads between members?Is it random??

Then i read the following line mongo official site.

"To prevent sequential reads from jumping around in time, the driver can associate application threads to a specific member of the set after the first read, thereby preventing reads from other members. The thread will continue to read from the same member".

Url - https://docs.mongodb.com/manual/core/read-preference-mechanics/#replica-set-read-preference-behavior-nearest

Now ,according to the above statement.Once the connection is made to one member of replica set,all further communication happens through that member only(Request Association), until the connection gets broken.

  1. So , how is load getting distributed between members of replica set?

  2. Is there any way to distribute loads between all the members of replica set equally?

The distribution must be based on current load on server as done by load balancers.


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>