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

Investigate large delays in connection establishment

    XMLWordPrintableJSON

Details

    • Service Arch
    • ALL
    • 0
    • 6

    Description

      The following is a snippet from SpecificPool::spawnConnections that spawns new connections for connection pools:

      // spawn enough connections to satisfy open requests and minpool, while honoring maxpool
      void ConnectionPool::SpecificPool::spawnConnections() {
          ...
          for (decltype(allowance) i = 0; i < allowance; ++i) {
              OwnedConnection handle;
              try {
                  handle = _parent->_factory->makeConnection(_hostAndPort, _sslMode, _generation);
              } catch (std::system_error& e) {
                  ...
              }
              ...
              handle->setup(_parent->_controller->pendingTimeout(),
                            guardCallback([this](auto conn, auto status) {
                                finishRefresh(std::move(conn), std::move(status));
                            }),
                            _parent->getName());
          }
      }
      

      This ticket should investigate (and fix) the underlying cause for sporadic large delays (more than 50 milliseconds) in connection establishment.

      This delay can be measured by capturing current time (e.g., using _parent->_factory->now()) before calling into TLConnection::setup and before running the callback function.

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: