I am using ReactiveMongo 0.12 with MongoDB 3.4. I am trying to understand how connection pooling works with MongoDB.
I have MongoDB installed in my remoteAddrr:27017. And I am using ReactiveMongo in my code as below.
import reactivemongo.api.MongoConnection
val driver = new reactivemongo.api.MongoDriver
val connection = driver.connection(List("remoteAddrr:27017"))
According to documentation:
MongoConnectionis a logical connection, not a physical one (not a network channel); It’s actually a connection pool. By default, aMongoConnectioncreates 10 physical network channels to each node.
So, in my code, I suppose the ReactiveMongo connection pool establishes 10 physical connections to the node remoteAddrr:27017.
But when I tested serverStatus inside mongo shell,
>var status = db.serverStatus()
> status.connections
{ "current" : 20, "available" : 51180, "totalCreated" : 66 }
So, how is it possible that there are 20 connections in the current shell session ? How is it possible that the number of unused incoming connections available is 51180 ? I also don't understand how the count of all incoming connections created to the server is 66.
serverStatusBTW, would rather not use such command but have a look at server log with a single client connected. - cchantepserverStatusand what specifically to look at in the log ? - oblivion