一、逐条写入性能测试脚本
[[email protected] bin]# ./mongo 172.27.8.118:40000
SHARDING_2:PRIMARY> use admin
switched to db admin
SHARDING_2:PRIMARY> db.auth(‘wlan‘,‘wlan‘)
SHARDING_2:PRIMARY> use estestdbnew
switched to db estestdbnew
SHARDING_2:PRIMARY> for(var i=0;i<1000;i++){db.estestdbnew.insert({name:"new", age:999})}
一、批量写入性能测试脚本
var bulk = db.test.initializeUnorderedBulkOp();for(var i=0;i<100000;i++){bulk.insert( { item: "abc123", defaultQty: 100, status: "A", points: 100 } )} ---写入十万条bulk.execute();
时间: 2024-10-12 11:42:49