How to get rid of idle connections

1,719 views
Skip to first unread message

FAISAL-KK FALAH

unread,
Aug 3, 2015, 7:47:18 AM8/3/15
to mongod...@googlegroups.com
Hi ,

I'm creating number of parallel connections to MongoDB using mgo driver(Golang).

There is a constant increase in number of connections in MOngoDB,day by day.I'm using mgo driver in ideal way by Copying a parent session and closing child session after use.

Some Stats form MongoDB :

>>>>>1.Number of connections :

db.serverStatus().connections

{ "current" : 431, "available" : 388, "totalCreated" : NumberLong(15663) }

"current " will be say 446 tomorrow..

>>>>>2.Out put of db.currentOp(true).inprog has 442 entries and 431 looks like:

{

"opid" : 3067247,

"active" : false,

"op" : "query",

"ns" : "",

"query" : {

"getLastError" : 1

},

"client" : "192.168.1.4:59916",

"desc" : "conn15601",

"threadId" : "0x7f3cdeff1700",

"connectionId" : 15601,

"waitingForLock" : false,

"msg" : "waiting for write concern",

"killPending" : true,

"numYields" : 0,

"lockStats" : {

"timeLockedMicros" : {

},

"timeAcquiringMicros" : {

}

}

}

 What I guess is by something I'm doing at client is wrong,But I couldn't find what exactly.

How to kill all these idle connections?What might reason to create such infinite waiting connections?


Regards,

Faisal K K 


 

Rhys Campbell

unread,
Aug 4, 2015, 3:40:47 AM8/4/15
to mongodb-user
Check the maxIdleTimeMS value of your connection string.

Reply all
Reply to author
Forward
0 new messages