Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-26720

Need to prepare initial connection between mongos and mongod

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.10
    • Component/s: Networking
    • Labels:
      None
    • Service Arch
    • Service Arch 2022-04-18, Service Arch 2022-05-02

      After looking source code and some testing,
      I have recognized that mongos does not prepare connection to mongod even though mongo client connector established connections(between client drivers and mongos).

      But this is a little bit risky at service starting time.
      Usually service starting time, huge user requests are transmitted to mongod via mongos. But this time, there's no connections are established between mongos and mongod. To make things worse, mongos need to open connections for all mongod shards and need to authenticate for user.

      These overheads cause connection spike at service starting time. (Look at the attached mongod connections metric graphs). In this test, there's only 14 mongos, But some service need to run 150 mongos.

      If there's 150 mongos, connections of each mongod shard is spike to 30000. In this case, mongod server can't processing user request because mongod is too busy to open and close connection. Eventually mongod servers are hang.

      So I think there's some preparation of connections between mongos and mongod. In current version, there's no way to control connections before running query.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            sunguck.lee@gmail.com 아나 하리
            Votes:
            1 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated: