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

Need to prepare initial connection between mongos and mongod



    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Critical - P2 Critical - P2
    • None
    • 3.2.10
    • Networking
    • 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.




            backlog-server-servicearch Backlog - Service Architecture
            sunguck.lee@gmail.com 아나 하리
            1 Vote for this issue
            16 Start watching this issue