node.js - Mongoose not closing connections -


i'm using mongoose connect mongodb server on production.

  mongo   : {     uri    : process.env.mongo_url,     options: {       user   : process.env.mongo_user,       pass   : process.env.mongo_pass,       server : {         socketoptions: {           keepalive       : 1,           sockettimeoutms : 300000,           connecttimeoutms: 300000         }       },       replset: {         rs_name      : process.env.mongo_rs_name || "set-name",         socketoptions: {           keepalive       : 1,           sockettimeoutms : 300000,           connecttimeoutms: 300000         },         readpreference: 'secondarypreferred',         poolsize: 50       }     }    }    

i've set tcp_keepalive_time 120:

echo 120 | sudo tee /proc/sys/net/ipv4/tcp_keepalive_time

the problem connections keep opening server never closing.

  1. why connections keep opening server?
  2. why connections not being closed?


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -