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.
- why connections keep opening server?
- why connections not being closed?
Comments
Post a Comment