Excessive CPU usage for idle tailable cursors

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.5.0
    • Component/s: Internal Code
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Tailing a capped collection with await_data is sometimes recommended as a simple pub / sub system. But if no documents are being inserted into the collection, each tailable cursor checks for new documents every 2ms. In my system, this means that 10 subscribers spin the CPU at 36%.

      A better solution would be a condition variable per collection that is notified when documents are inserted.

              Assignee:
              Randolph Tan
              Reporter:
              A. Jesse Jiryu Davis
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: