Load Balancing with connection pool

When read/write comes from the client, does load balancing occur automatically if you configure it as a connection pool?
Or should I attach L4 to the secondary and distribute the read separately?

Hi @Kim_Hakseon,

We do not recommend placing a load balancer in front of the replica set and it certainly might yield unexpected results.

You should specify all seed hosts in a connection string. The connection pool with the default readPreference (Primary) does not load balance connections across members and direct all to the Primary. However, if you specify readPreference of secondaryPreferred or secondary the connection for reads will be round robin across replica set.

What we suggest for specific workload isolation is to tag specific members using replica set tags and then point specific read workloads like analytics to specific nodes.

Best
Pavel

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.