Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-42

Using tailable + awaitdata causes high cpu load

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • None
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      This is independent of driver or hardware. It could be reproduced on different machines.
      But here is one of them:

      macos 10.8.3, mb air 1.8 Ghz i7 64 bit

      On my machine it takes about 10% per cursor. Adding mor cursors adds more load, up to 50%.

      Issue is reproduced by several people.
      I am from nodejs, so I can only give you this code to reproduce the issue:

      To reproduce the issue:

      you need to npm i mubsub

      and here is the code

      var mubsub = require('mubsub');

      var client = mubsub('mongodb://localhost:27017/test?poolSize=5',

      {safe: true}

      );
      var channel = client.channel('mubsub');

      channel.subscribe(console.log);
      channel.subscribe(console.log);
      channel.subscribe(console.log);
      channel.subscribe(console.log);
      channel.subscribe(console.log);
      channel.subscribe(console.log);
      channel.subscribe(console.log);
      channel.subscribe(console.log);
      channel.subscribe(console.log);

      Original issue on nodes driver tracker:

      https://github.com/mongodb/node-mongodb-native/issues/963

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            kof Oleg Slobodskoi
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: