-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Networking & Observability
The drivers' server selection algorithm uses the "Power of Two Choices With Least Connections" load balancing algorithm to choose between multiple suitable hosts. The the algorithm involves picking two random servers from the available choices and then selecting the server that is currently receiving fewer operations from those two. This has the effect of evenly distributing load among servers even when some of the servers are slower to fulfill requests than others, which pure random selection does not achieve. Since hedged reads are being removed in SPM-3750, this could be especially helpful to avoid targeting slower nodes.
See the drivers spec for more information: https://github.com/mongodb/specifications/blob/e9f02f328a93d6a0321694cc30d031079c555e4a/source/server-selection/server-selection.md#operationcount-based-selection-within-the-latency-window-multi-threaded-or-async