mkdir 2shards 3shards 1shard cd 2shards mlaunch init --sharded 2 --single --port 29000 mongo --port 29000 ../2shards.js for i in 0 1 2; do mongo --port 2900$i --eval "printjson(db.version()); printjson(db.foo.stats().avgObjSize); printjson(db.foo.stats(1024).avgObjSize);"; done mlaunch stop rm -R data cd .. cd 3shards mlaunch init --sharded 3 --single --port 29010 mongo --port 29010 ../3shards.js for i in 0 1 2 3; do mongo --port 2901$i --eval "printjson(db.version()); printjson(db.foo.stats().avgObjSize); printjson(db.foo.stats(1024).avgObjSize);"; done mlaunch stop rm -R data cd .. cd 1shard mlaunch init --sharded 1 --single --port 29020 mongo --port 29020 ../1shard.js for i in 0 1; do mongo --port 2902$i --eval "printjson(db.version()); printjson(db.foo.stats().avgObjSize); printjson(db.foo.stats(1024).avgObjSize);"; done mlaunch stop rm -R data cd ..