sharding not balancing well

20 views
Skip to first unread message

amin gounine

unread,
Feb 22, 2013, 2:34:58 AM2/22/13
to mongod...@googlegroups.com
Hello,

I did a mongorestore of a standalone collection to a cluster sharding, but my collection is not balancing well.
My shard key is the automatical _id

 db.test.getShardDistribution()

Shard shard0000 at noeud4:27017
 data : 14.83Gb docs : 2462218 chunks : 18
 estimated data per chunk : 843.66Mb
 estimated docs per chunk : 136789

Shard shard0002 at noeud2:27017
 data : 119.19Mb docs : 1963795 chunks : 2
 estimated data per chunk : 59.59Mb
 estimated docs per chunk : 981897

Totals
 data : 14.94Gb docs : 4426013 chunks : 20
 Shard shard0000 contains 99.22% data, 55.63% docs in cluster, avg obj size on shard : 6kb
 Shard shard0002 contains 0.77% data, 44.36% docs in cluster, avg obj size on shard : 63b

What is the problem? How can I do to have a balanced distribution?

Thank you.

Moacy Barros

unread,
Apr 26, 2013, 11:04:52 AM4/26/13
to mongod...@googlegroups.com
Hello amin,

I is due your shard key choice, you have detailed explanation here: http://docs.mongodb.org/manual/core/sharded-cluster-internals/#write-scaling

"ObjectID is computed upon document creation, that is a unique identifier for the object. However, the most significant bits of data in this value represent a time stamp, which means that they increment in a regular and predictable pattern. Even though this value has high cardinality, when using this, any date, or other monotonically increasing number as the shard key, all insert operations will be storing data into a single chunk, and therefore, a single shard. As a result, the write capacity of this shard will define the effective write capacity of the cluster."




Regards,
Moacy
Reply all
Reply to author
Forward
0 new messages