Skip to content

Instantly share code, notes, and snippets.

@digitalwm
Created July 22, 2014 12:04
Show Gist options
  • Save digitalwm/062b4b24773453bc785d to your computer and use it in GitHub Desktop.
Save digitalwm/062b4b24773453bc785d to your computer and use it in GitHub Desktop.
Load test a mongoDB instalation
db.foo.insert( { _id : 1 } )
ops = [{ op : "findOne" , ns : "test.foo" , query : { _id : 1 } }, { op : "update" , ns : "test.foo" , query : { _id : 1 } , update : { $inc : { x : 1 } } } ]
for ( x = 1; x<=128; x*=2){
res = benchRun( { parallel : x ,
seconds : 5 ,
ops : ops
} )
print( "threads: " + x + "\t queries/sec: " + res.query )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment