JS Benchmarking Harness

This benchRun command is designed as a QA baseline perf measurement tool, not designed to be a "benchmark".

CODE:

db.foo.drop();
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 )
}

Dynamic values

res = benchRun( { ops : [ { ns : t.getFullName() , 
                            op : "update" , 
                            query : { _id : { "#RAND_INT" : [ 0 , 100 ] } } ,
                            update : { $inc : { x : 1 } } } ] , 
                  parallel : 2 , 
                  seconds : 1 ,
                  totals : true } ) 
  • dynamic operatos
    • RAND_INT [ min , max , <multiplier >
      • [ 0 , 10 , 4 ] would produce random numbers between 0 and 10 and then multiply by 4

More info:

http://github.com/mongodb/mongo/commit/3db3cb13dc1c522db8b59745d6c74b0967f1611c

Follow @mongodb

MongoDB Pittsburgh - May 15
MongoNYC - May 23
MongoDB Paris - Jun 14
MongoDB UK - Jun 20
MongoDC - June 26


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

PLEASE POST QUESTIONS IN THE USER GROUPS FORUM. Post non-question comments and helpful hints here.

blog comments powered by Disqus