[DOCS-8751] PyMongo with Network Load Balancer Created: 02/Sep/16  Updated: 30/Oct/23  Due: 30/Sep/16  Resolved: 01/Feb/21

Status: Closed
Project: Documentation
Component/s: drivers, manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Minor - P4
Reporter: James Phelan (Inactive) Assignee: Ravind Kumar (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 3 years, 1 week, 2 days ago
Epic Link: DOCSP-1769

 Description   

Hi

While doing some research I have found information from two different documentation sources that seem to contradict each other.

The first source is within the sharding documentation at docs.mongodb.com the url is https://docs.mongodb.com/manual/core/sharded-cluster-components/#production-configuration. Here the "Production Configuration" states:

“You can deploy a mongos router on each application server to ensure each server has consistent access to the sharded cluster. Alternatively, deploy a group of mongos routers and use a proxy or load balancer between the application and the mongos group. In these deployments, you must configure the load balancer for client affinity such that every connection from a single client reaches the same mongos.”

This indicates that the use of a network load balancer is supported if client affinity is implemented on the load balancer.

The second source is within the drivers documentation at the following url: http://api.mongodb.com/python/current/examples/high_availability.html

At the end of this page the following is stated:

“Warning: Do not connect PyMongo to a pool of mongos instances through a load balancer. A single socket connection must always be routed to the same mongos instance for proper cursor support.”

This indicates that the use of a network load balancer is not supported under any circumstances, maybe the PyMongo documentation needs to be updated to add the caveat that client affinity must be enabled. This was done previously done in DOCS-2334 for the core documentation.

Regards
James



 Comments   
Comment by Nathan Leniz [ 01/Feb/21 ]

Closing due to inactivity.

Comment by Nathan Leniz [ 27/Jan/21 ]

james.phelan it looks like this issue has gone away with updates to the server page not mentioning placing mongos behind a load balancer. Safe to close it?

Generated at Thu Feb 08 07:56:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.