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

slowness in mongos when dealing with replset due to getServerAddress() calls

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.2.3, 2.4.0-rc0
    • Component/s: Performance
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      This can be seen easily when running a high performance test (1000s of rps) with multiple threads (10+) and comparing the performance between replset and master/slave.

      Show
      This can be seen easily when running a high performance test (1000s of rps) with multiple threads (10+) and comparing the performance between replset and master/slave.

      Description

      When doing high performance benchmark with a 2 shard cluster, throughput was 2.5x higher when using master/slave rather than replset.
      This is obviously a huge performance degradation.
      From profiling it seems due to the many calls to DBClientReplicaSet.getServerAddress() which take a lock.
      By applying the tiny provided patch that caches the value, the issue goes away.

        Attachments

        1. cacheAddr.diff
          1 kB
        2. gprof-slowreplset.pdf
          22 kB
        3. res2.pdf
          21 kB
        4. res3.pdf
          23 kB

          Activity

            People

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            pasette Daniel Pasette
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: