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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.3, 2.4.0-rc0
    • Affects Version/s: 2.2.2
    • Component/s: Performance
    • None
    • ALL
    • 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.

      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.

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

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: