What is the difference between poolSize and maxPoolSize

Hello,

So while doing the course, one if the tickets was about connection pooling, and in that instance we used poolSize=50

MongoClient.connect(
        process.env.MFLIX_DB_URI,
        { useNewUrlParser: true,
          poolSize: 50,
          wtimeout: 2500},
 )

Which is the first setting at the top of the link below for the Node.js drivers (see poolSize).

Global (mongodb.github.io)

However in the final exam question 3, we are asked about capping the poolsize, and on following the link: -

The setting for setting the connection is maxPoolSize for the URI connection string.

The Question = Are we talking about two different things, why the differences?

Hi NeilM,
maxPoolSize and poolSize are the same, except they relate to whether you are using the useUnifiedTopology: true setting.
If you are using useUnifiedTopology: true maxPoolSize is the spec-compliant setting to manage how large connection pools can be.
But if you are using useUnifiedTopology: false (or omits it) poolSize is the same thing but it’s a remnant from before we had the unified topology.
Albeit, in the 4.x version of the driver this duplication has been removed.

In case you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.