mongo java - Mongodb Logs shows too many connections open -
why mongodb logs show many opened connections? it's showing me more maximum connection limit , number of current operations in db.
also primary refused create more connections after reaching 819 limit. time, number of current operations in db less 819. raising ulimit has solved problem temporarily, why idle connections not utilized serve requests?
i having exact same problem. connection number kept growing , growing until hit 819 , no more connections allowed.
i'm using mongo-java-driver version 2.11.3. has seemed fix problem explicitly setting connectionsperhost , threadsallowedtoblockforconnectionmultiplier properties of mongoclient. before not setting these values myself , accepting defaults.
mongoclientoptions mco = new mongoclientoptions.builder() .connectionsperhost(100) .threadsallowedtoblockforconnectionmultiplier(10) .build(); mongoclient client = new mongoclient(addresses, mco); //addresses pre-populated list of serveraddress objects
in application mongoclient defined static singleton.
i watching mongodb logs, , once application hit 100 open connections didn't see more connections established client application. running replica set, still see internal connections being made close.
Comments
Post a Comment