Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1404

Improve performance of SelectServer

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.0
    • Affects Version/s: None
    • Component/s: Server Selection
    • Labels:
      None
    • Fully Compatible

      We're seeing a large fraction of time being spent in server selection; around 30% of the time taken by "driver.Operation.Execute" is being spent in "driver.Operation.selectServer", vs 45% for "driver.Operation.roundTrip", which obviously includes network roundtrip(s).

      A large fraction of "driver.Operation.selectServer" seems to be around "Subscribe", and it seems that could easily be avoidable in an initial fast path, where you'd expect a server to always be available. Related to this, we're also seeing server selection timeouts with a 20ms server selection timeout – it appears that the subscription logic is sometimes slow enough that we're hitting that timeout even if server selection could otherwise be satisfied.

        1. cpu.pprof
          10 kB
        2. server_selection.go
          1 kB

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            bartle David Bartley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: