Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-8751

PyMongo with Network Load Balancer

      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

            Assignee:
            ravind.kumar Ravind Kumar (Inactive)
            Reporter:
            james.phelan@mongodb.com James Phelan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              3 years, 11 weeks, 3 days ago