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

Sharding GridFS has write bottleneck

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL

      Description

      As https://docs.mongodb.com/manual/core/gridfs/#sharding-gridfs
      says chunks sharding key should be files_id but it's an objectid and changes monotonically.

      As https://docs.mongodb.com/manual/reference/limits/#Monotonically-Increasing-Shard-Keys-Can-Limit-Insert-Throughput
      says
      ```
      For clusters with high insert volumes, a shard keys with monotonically increasing and decreasing keys can affect insert throughput. If your shard key is the _id field, be aware that the default values of the _id fields are ObjectIds which have generally increasing values.
      ```
      So the choice of files_id will lead to the write of gridfs chunks always happens on a single shard.
      It's really a big problem because if someone use gridfs it always means there will be a lot of files data to store and need sharding.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: