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

Storage size keeps growing while count and size stay constant in session-like workload

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      This code is intended to simulate a session collection with a lot of resizing updates (2-16K objects) and purging of old records

      function makestr {
      var x = 'x';
      for (var jj=0; jj<n; jj++)
      x += x;
      return x
      }

      for (var z=0; z < 10; z++){
      for (var i=0; i < 100000; i++){
      db.foo.save({_id: i%1000 + (z+1)*1000, x: makestr(10 + 4*Math.random())});
      if (Math.random() < 0.10)
      db.foo.remove({_id: Math.floor(i%1000)+ (z*1000)})
      }
      print(z);
      }

      > db.foo.stats()
      {
      "ns" : "test.foo",
      "count" : 1001,
      "size" : 24420796,
      "storageSize" : 110223616,
      "numExtents" : 13,
      "nindexes" : 1,
      "lastExtentSize" : 21640960,
      "paddingFactor" : 1.0099999999990539,
      "flags" : 1,
      "totalIndexSize" : 376832,
      "indexSizes" :

      { "_id_" : 376832 }

      ,
      "ok" : 1
      }

      storageSize / size = 4.513514465294252

      After dropping foo and bumping z to 50:
      > db.foo.stats()
      {
      "ns" : "test.foo",
      "count" : 1001,
      "size" : 24186240,
      "storageSize" : 347017216,
      "numExtents" : 16,
      "nindexes" : 1,
      "lastExtentSize" : 64619008,
      "paddingFactor" : 1.0099999999952884,
      "flags" : 1,
      "totalIndexSize" : 1851392,
      "indexSizes" :

      { "_id_" : 1851392 }

      ,
      "ok" : 1
      }
      > 347017216/24186240
      14.347712418300654

      Attachments

        Activity

          People

            eliot Eliot Horowitz (Inactive)
            mathias@mongodb.com Mathias Stearn
            Votes:
            6 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: