[SERVER-1025] Storage size keeps growing while count and size stay constant in session-like workload Created: 15/Apr/10  Updated: 01/Feb/12  Resolved: 01/Feb/12

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Eliot Horowitz (Inactive)
Resolution: Duplicate Votes: 6
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 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



 Comments   
Comment by Eliot Horowitz (Inactive) [ 01/Feb/12 ]

See SERVER-2958

Generated at Thu Feb 08 02:55:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.