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

Ability to specify the batch size in data size

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:
      None
    • Case:

      Description

      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`.

        Attachments

          Activity

            People

            Assignee:
            backlog-query-optimization Backlog - Query Optimization
            Reporter:
            linda.qin Linda Qin
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            17 Start watching this issue

              Dates

              Created:
              Updated: