Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-50968

Uneven distribution of data in sharded cluster

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Server Triage

      MongoDB Version: 4.2.1

      We have a sharded collection where the shard key is

      {'_id': 'hashed'}

      and since it has random bytes it should ideally not lead to hot-spotting.

      The default chunk size has not been changed (default 64MB for the version).

      We are seeing that the chunks are not evenly distributed among the shards and the majority of data is residing in one shard.

       


      Shard shard7 at shard7/mongo-7:27107,mongo-8:27107,mongo-9:27107
      data : 12.78GiB docs : 3085345 chunks : 408
      estimated data per chunk : 32.08MiB
      estimated docs per chunk : 7562

      Shard shard1 at shard1/mongo-1:27101,mongo-2:27101,mongo-3:27101
      data : 12.87GiB docs : 3100445 chunks : 408
      estimated data per chunk : 32.3MiB
      estimated docs per chunk : 7599

      Shard shard6 at shard6/mongo-6:27106,mongo-7:27106,mongo-8:27106
      data : 12.78GiB docs : 3085358 chunks : 408
      estimated data per chunk : 32.09MiB
      estimated docs per chunk : 7562

      Shard shard5 at shard5/mongo-5:27105,mongo-6:27105,mongo-7:27105
      data : 12.75GiB docs : 3077756 chunks : 407
      estimated data per chunk : 32.09MiB
      estimated docs per chunk : 7562

      Shard shard9 at shard9/mongo-1:27109,mongo-2:27109,mongo-9:27109
      data : 12.75GiB docs : 3077789 chunks : 408
      estimated data per chunk : 32MiB
      estimated docs per chunk : 7543

      Shard shard8 at shard8/mongo-1:27108,mongo-8:27108,mongo-9:27108
      data : 12.79GiB docs : 3085283 chunks : 407
      estimated data per chunk : 32.18MiB
      estimated docs per chunk : 7580

      Shard shard2 at shard2/mongo-2:27102,mongo-3:27102,mongo-4:27102
      data : 104.98GiB docs : 25320636 chunks : 408
      estimated data per chunk : 263.48MiB
      estimated docs per chunk : 62060

      Shard shard3 at shard3/mongo-3:27103,mongo-4:27103,mongo-5:27103
      data : 12.76GiB docs : 3085332 chunks : 408
      estimated data per chunk : 32.04MiB
      estimated docs per chunk : 7562

      Shard shard4 at shard4/mongo-4:27104,mongo-5:27104,mongo-6:27104
      data : 12.75GiB docs : 3077839 chunks : 407
      estimated data per chunk : 32.09MiB
      estimated docs per chunk : 7562

      Totals
      data : 207.25GiB docs : 49995783 chunks : 3669
      Shard shard7 contains 6.16% data, 6.17% docs in cluster, avg obj size on shard : 4KiB
      Shard shard1 contains 6.21% data, 6.2% docs in cluster, avg obj size on shard : 4KiB
      Shard shard6 contains 6.16% data, 6.17% docs in cluster, avg obj size on shard : 4KiB
      Shard shard5 contains 6.15% data, 6.15% docs in cluster, avg obj size on shard : 4KiB
      Shard shard9 contains 6.15% data, 6.15% docs in cluster, avg obj size on shard : 4KiB
      Shard shard8 contains 6.17% data, 6.17% docs in cluster, avg obj size on shard : 4KiB
      Shard shard2 contains 50.65% data, 50.64% docs in cluster, avg obj size on shard : 4KiB
      Shard shard3 contains 6.16% data, 6.17% docs in cluster, avg obj size on shard : 4KiB
      Shard shard4 contains 6.15% data, 6.15% docs in cluster, avg obj size on shard : 4KiB


       

      The result from sh.status(true) can be found here. None of the chunks are marked as Jumbo. 

       

            Assignee:
            backlog-server-triage [HELP ONLY] Backlog - Triage Team
            Reporter:
            sankush04@gmail.com Ankush Sinha
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: