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

Ability to specify the batch size in data size

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Optimization

      When we run a query on a sharded cluster, if batch size is not specified, the shards will return the results with the default batch size (16MB). For a sharded cluster with a large number of shards (e.g. 80 shards), this could cause high memory usage on the mongos (16MB * 80 = 1.28G).

      Currently we can specify the batch size in term of the number of documents. If the average document size is already known, we can specify the batch size to reduce the memory usage in this case. However, in some cases, specifying the batch size by the number of documents might not be very optimal:

      • The document size varies for the collection.
      • Projection is being used in the query, so it's hard to predicate how much data will be returned without first querying the document.

      It would be nice to allow specifying the batch size in term of the data size. Also it would be nice if the size based batch limit (the default 16MB) could be customized with a `setParameter`.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            linda.qin@mongodb.com Linda Qin
            Votes:
            0 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated: