How to Get the MongoDB Chunk Size
Recently we found the traffic is not balanced across the MongoDB cluster shards. After investigation, the root cause is that data on each shard is not evenly distributed (Chunk balancing != data balancing != traffic balancing). The data distribution looks like this:
Shard | Data Size |
---|---|
mongo-0 | 10.55 GB |
mongo-1 | 25.76 GB |
mongo-2 | 10.04 GB |
Why the data size of mongo-1
is significantly large than
others while the chunk number among 3 shards is almost the same? Then we
need to analysis the chunk size distribution across these shards.