|
We need to verify that parallel flushes will allow us to overcome the disk latency.
One way to simply check this is to have multiple threads in mongoD flushing different data files in parallel.
In order for this test to make sense, the load on the database should be uniformly distributed.
Here is an example script used before in Azure testing:
db.getSisterDB("dat").test.ensureIndex({s : 1})
|
db.getSisterDB("dat").test.ensureIndex({x : 1, s : 1})
|
|
function makeid()
|
{
|
var text = "";
|
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
for( var i=0; i < 20; i++ )
|
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
|
return text;
|
}
|
|
while(true)
|
{
|
sp = Math.floor((Math.random()*100)+1);
|
for(i=0;i<sp;i++)
|
{
|
id = Math.floor((Math.random()*1000000000)+1);
|
sx = makeid()
|
db.getSisterDB("dat").test.save({_id : id, x: new ObjectId(), s : sx});
|
}
|
wait = 25000000;//Math.floor((Math.random()*1000000)+1);
|
for(i=1000;i<wait;i++) {}
|
}
|
The expectation is that 2 threads should allow us to get ~200+ IOPS (writes/sec in windows perf mon)
|