I'm testing the MongoDB Sharding with a Sharded Collection and a forloop to insert arround 1M documents to see how splitting and moving works.
I'm surprise that after few documents MongoDB starts to split chunks (well before 64MB),
At the end of the 1M (and some) inserts i have thoses stats :
mongos> db.users.getShardDistribution()
Shard rs0 at rs0/mongod00.local.net:2000,mongod01.local.net:2001,mongod02.local.net:2002
data : 84.76MiB docs : 1010010 chunks : 9
estimated data per chunk : 9.41MiB
estimated docs per chunk : 112223
Totals
data : 84.76MiB docs : 1010010 chunks : 9
Shard rs0 contains 100% data, 100% docs in cluster, avg obj size on shard : 88B
Why MongoDB created 9 chunks of a collection that contains 85MB?
I didn't change the defaut chunk size parameter:
mongos> db.settings.findOne()
{ "_id" : "chunksize", "value" : 64 }
Thanks,
Max.