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

Client is communicating with the server even if no commands are being issued

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.0.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Linux with connecting to Docker image.

      Description

      Even just connecting to MongoDB server from node client seems to have traffic on the connection every 5 seconds, even when there are no queries being issues by the client. Why is this? Is this really necessary? I am investigating using MongoDB in the resource constrained environment and I was surprised about this. Is there a way to disable this?

      Reproduction. Using the following script:

      const MongoClient = require('mongodb').MongoClient;
       
      const url = 'mongodb://localhost:27017';
      const dbName = 'app';
      const mongoClientPromise = MongoClient.connect(url);
      

      Running MongoDB inside Docker:

      docker run -d --rm -p 27017:27017 --name mongo mongo:3.6.3 --replSet app
      

      Running the above script:

      node test.js
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mitar Mitar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: