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

MongoDB authentication is 37x slower in 3.0.8 vs 2.6.11

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.8
    • Component/s: Performance, Security
    • None
    • Environment:
      OS X, Linux
    • Fully Compatible
    • ALL
    • Hide

      Reproduced with non-enterprise versions 3.0.8 and 2.6.11 using Node.js driver driver 5.4.1 with module 2.1.3. Swapping only the MongoDB binaries used and clean data folder paths and using the same Node.js driver and test code in both timing runs.

      Prequisites: Install mtools, m and node on single Mac OS X system. Install both mongodb versions using m.

      Cluster configuration for 2.6.11:
      mlaunch init --replicaset --port 27017 --nodes 3 --binarypath /usr/local/m/versions/2.6.11/bin --hostname localhost --auth --auth-user user --auth-password password --smallfiles --mongos 1 --config 1 --sharded sh1 sh2 sh3

      Cluster configuration for 3.0.8:
      mlaunch init --replicaset --port 27017 --nodes 3 --binarypath /usr/local/m/versions/3.0.8/bin --hostname localhost --auth --auth-user user --auth-password password --smallfiles --mongos 1 --config 1 --sharded sh1 sh2 sh3

      When the cluster is spun-up, add userid before running the test Node.js code:

      mongo -u user -p password admin
      > use node_test_db
      > db.createUser(
          {
               user: "node_test",
               pwd: "password",
               roles: [ { role: "dbOwner", db: "node_test_db" } ]
          }
      )
      

      Run a node.js script that opens multiple connections to the node_test_db mongos process in a batch, then authenticates those connections in a batch, and reporting the total timings for each batch.

      Show
      Reproduced with non-enterprise versions 3.0.8 and 2.6.11 using Node.js driver driver 5.4.1 with module 2.1.3. Swapping only the MongoDB binaries used and clean data folder paths and using the same Node.js driver and test code in both timing runs. Prequisites: Install mtools , m and node on single Mac OS X system. Install both mongodb versions using m . Cluster configuration for 2.6.11: mlaunch init --replicaset --port 27017 --nodes 3 --binarypath /usr/local/m/versions/2.6.11/bin --hostname localhost --auth --auth-user user --auth-password password --smallfiles --mongos 1 --config 1 --sharded sh1 sh2 sh3 Cluster configuration for 3.0.8: mlaunch init --replicaset --port 27017 --nodes 3 --binarypath /usr/local/m/versions/3.0.8/bin --hostname localhost --auth --auth-user user --auth-password password --smallfiles --mongos 1 --config 1 --sharded sh1 sh2 sh3 When the cluster is spun-up, add userid before running the test Node.js code: mongo -u user -p password admin > use node_test_db > db.createUser( { user: "node_test", pwd: "password", roles: [ { role: "dbOwner", db: "node_test_db" } ] } ) Run a node.js script that opens multiple connections to the node_test_db mongos process in a batch, then authenticates those connections in a batch, and reporting the total timings for each batch.
    • Security 10 (02/19/16), Security 11 (03/11/16), Security 12 (04/01/16)

      Connections timings remain similar, however authentication is about 37x slower and test timings of various counts of authenticated connections show a linear timing correlation with connection count.

      Version 2.6.11 Repro Test Timings

      Trial Connections   Connect (secs)    Auth(secs)
      1        200          0.215             0.275
      2        200          0.212             0.273
      3        150          0.161             0.204
      4        150          0.161             0.205
      5        100          0.110             0.140
      5        100          0.112             0.145
      

      Version 3.0.8 Repro Test Timings

      Trial Connections   Connect (secs)    Auth(secs)
      1        150          0.162             7.685
      2        150          0.161             7.734
      3        100          0.111             5.229
      4        100          0.111             5.190
      5         10          0.020             0.550
      6         10          0.170             0.546
      7          1          0.017             0.095
      8          1          0.018             0.010
      

      Reproduced with non-enterprise versions 3.0.8 and 2.6.11 using Node.js driver 5.4.1 with module 2.1.3.

            Assignee:
            andreas.nilsson Andreas Nilsson
            Reporter:
            scott.kurowski@mongodb.com Scott Kurowski
            Votes:
            0 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved: