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

Large Number of TCP Connections being created and not removed

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.4
    • Affects Version/s: 2.2.2
    • Component/s: MongoDB 3.2
    • Labels:
    • Environment:
      MAAS - MongoDB Atlas - ReplicaSet
      Client:
      SO - Ubuntu 14.04.3 LTS 64bits
      Node - 4.4.3
      mongodb module - v2.2.2

      I have created a MongoDB Atlas deployment (replicaSet) with 3 nodes (1P, 2S), and I'm connecting to MongoDB from my node web app as explained here.

      The problem is when my web app make a request (ex: a find) sometimes is created a new TCP connection others it reuses an existing one but TCP connections are never removed and it results in a lot of connections shown in mongoDB atlas metrics. ( it reached 225 connections in primary node )

      I have read your FAQ Does TCP keepalive time affect MongoDB Deployments? and after that I changed that property to 120 (2 minutes) but the connections still not being removed.

      Note:
      1 - I am creating a singleton to access the DB only once in node web app.
      2 - I cannot use the property maxIdleTimeMS because isn't available in nodeJS driver.
      3 - This is also happening when I run node web app in windows 8.

      Is this situation normal ? how can I make those connections be removed after completed ?

      Regards

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            fabio Fabio Antunes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: