Text search with relevance sort consumes all memory and crashes the machine

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 5.0.18
    • Component/s: Text Search
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I have a collection of around 3m rather small documents. Total size of collection is <1GB.

      If I do a text search for a word that is present in many (~1.5m) documents (i.e. it finds almost all the documents) it takes some time but I get the results.

      If I also add `{ $sort:

      { $meta: 'textScore' }

      }` to sort by relevance it starts to consume memory like crazy effectively crashing the machine almost instantly.

      What may be wrong? Where to look?

      An interesting point: The whole database I am talking about would fit into our memory three fold.

      We were monitoring the memory consumption when the problem occurs. The system had 58% percent free memory one second. It dropped to 10 % free memory in one second. And than it crashed.

      Our version is 5.0.18

              Assignee:
              Unassigned
              Reporter:
              Josef Sábl
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: