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

Performance regression in 7.0 comparing with lower version

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 7.0 Required
    • Component/s: None
    • None
    • Product Performance
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Hi,

      I did a load test on v4.4.29 and v7.0.12. I understand there is some performance deviation when upgrading. But here the test shows a big deviation of about 4min run vs 67min run respectively.  This is 120% performance degradation and a huge difference comparatively. You can see 4.3K ops/sec in 4.4 vs 250ops/sec in 7.0Is it expected?

      I used a single member replicaset for both tests:

      4.4:

      replset:PRIMARY> use vinodh
      switched to db vinodh
      replset:PRIMARY> var randomName = function() {
      ...   // Base 36 uses letters and digits to represent a number:
      ...   return (Math.random()+1).toString(36).substring(2);
      ... };
      replset:PRIMARY> var day = 1000 * 60 * 60 * 24;
      replset:PRIMARY> var randomDate = function () {
      ...   return new Date(Date.now() - (Math.floor(Math.random() * day)));
      ... };
      replset:PRIMARY> new Date()
      ISODate("2024-06-29T13:41:15.985Z")
      
      replset:PRIMARY> for (var i = 1; i <= 1000000; ++i) {   db.version44Test.insertOne({       name: randomName(),       creationDate: randomDate(),       uid: i   }); }
      new Date()
      new Date()
      {
          "acknowledged" : true,
          "insertedId" : ObjectId("668010124e441d0a9616a43f")
      }
      replset:PRIMARY> new Date()
      ISODate("2024-06-29T13:45:54.886Z")
      replset:PRIMARY> new Date()
      ISODate("2024-06-29T13:45:54.886Z")
       

      7.0:

      replset [direct: primary] vinodh> var randomName = function() {
      ...   // Base 36 uses letters and digits to represent a number:
      ...   return (Math.random()+1).toString(36).substring(2);
      ... };
      replset [direct: primary] vinodh> var day = 1000 * 60 * 60 * 24;replset [direct: primary] vinodh> var randomDate = function () {
      ...   return new Date(Date.now() - (Math.floor(Math.random() * day)));
      ... };
      
      replset [direct: primary] vinodh> new Date()
      ISODate('2024-06-29T13:48:36.550Z')
      
      replset [direct: primary] vinodh> for (var i = 1; i <= 1000000; ++i) {
      ...   db.afterUpg7.insertOne({
      ...       name: randomName(),
      ...       creationDate: randomDate(),
      ...       uid: i
      ...   });
      ... }
      new Date()
      new Date()
      {
        acknowledged: true,
        insertedId: ObjectId('66802e58a034b0dc4d314517')
      }
      
      replset [direct: primary] vinodh> new Date()
      ISODate('2024-06-29T15:55:04.460Z')
      replset [direct: primary] vinodh> new Date()
      ISODate('2024-06-29T15:55:04.477Z')
       

      ftdc_7.0.tgzftdc_4.4.tgz

       

       

       

        1. MongoDB_writeTest_wmajority_j1-1.png
          MongoDB_writeTest_wmajority_j1-1.png
          380 kB
        2. MongoDB_writeTest_wmajority_j0.png
          MongoDB_writeTest_wmajority_j0.png
          473 kB
        3. MongoDB_writeTest_w1_j1.png
          MongoDB_writeTest_w1_j1.png
          397 kB
        4. MongoDB_7.0-insert performance.png
          MongoDB_7.0-insert performance.png
          241 kB
        5. MongoDB_4.4-insert performance.png
          MongoDB_4.4-insert performance.png
          231 kB
        6. ftdc_7.0.tgz
          3.15 MB
        7. ftdc_4.4.tgz
          1.96 MB

            Assignee:
            ger.hartnett@mongodb.com Ger Hartnett
            Reporter:
            vinodh.kct@gmail.com Vinodh Krishnaswamy
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: