Mongos selection

Hey there,
I couldn’t find information in the documentation on what happens if I specify multiple mongos instances within the connection string, e.G.:


Will all instances of my application connect to the instance, or will they randomly pick one, or how is the actual mongos instance being selected?

I am using mongoose which uses the latest mongo@3.6.0 node driver.

Hi @Jascha_Brinkmann,

If there is more than one mongos instance in the connection seed list, the driver determines which mongos is the “closest” (i.e. the member with the lowest average network round-trip-time) and calculates the latency window by adding the average round-trip-time of this “closest” mongos instance and the localThresholdMS . The driver will load balance randomly across the mongos instances that fall within the latency window.

See more details here: