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

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

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

      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 Unassigned
            Reporter:
            josef.sabl@gmail.com Josef Sábl
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: