we are using mongodb in our application for catching a lot of the data to reduce load from our main mysql database, for the last 2 3 days we are having an issue where the mongodb will hit the limit and will not accept anymore connections, hence stalling our whole application, we have a fairly large server with 32GB of Ram and 12 Core Processor, when I run


It returns

{ "current" : 1011, "available" : 50189, "totalCreated" : NumberLong(159685) }

My question is, why it only accepta 1011 connections and start rejecting others even though it has 50189 available connections? Or how can we increase that limit?

The logs say

2014-07-10T03:04:30.394-0400 DBClientCursor::init call() failed 2014-07-10T03:04:30.399-0400 Error: DBClientBase::findN: transport error: ns: admin.$cmd query: { whatsmyuri: 1 } at src/mongo/shell/mongo.js:146 exception: connect failed


  • What appears in the logs when mongodb refuses connections? – Flup Jul 10 '14 at 7:02
  • @Flup, I have edited the answer. – Architact Jul 10 '14 at 7:05
  • Can you comment on the version you are using - the treatment of max connections changed with 2.6 – Adam C Jul 10 '14 at 11:32
  • 1
    this output looks like version 2.6. however, it's not clear to me that you've run out of connections - this looks like an error caused by the shell not being able to connect to the server, not from the server giving an error because it cannot create/accept another connection. If you've run out of connections, there would be lots of errors in mongod log file of the sort "cannot create connection" or pthread no resources or some such. Are you sure it's mongod that's not accepting more connections? Rather than the network/machine? – Asya Kamsky Jul 28 '14 at 4:34
  • wasn't it maybe the open files limit? think it's around 1000 by default – milan Jan 25 '17 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.