Skip to content

Commit

Permalink
docs(NODE-3643): Discuss connection pool size options in 4.0 upgrade …
Browse files Browse the repository at this point in the history
…guide (#2992)
  • Loading branch information
kmahar authored Sep 30, 2021
1 parent 440517e commit 7998956
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/CHANGES_4.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,15 @@ stream.on('end', () => client.close());
### MongoClientOptions interface

With type hinting users should find that the options passed to a MongoClient are completely enumerated and easily discoverable.
In 3.x there were options, like `maxPoolSize`, that were only respected when `useUnifiedTopology=true` was enabled, vs `poolSize` when `useUnifiedTopology=false`.
We've de-duped these options and put together some hefty validation to help process all options upfront to give early warnings about incompatible settings in order to help your app get up and running correctly quicker!

#### Connection Pool Options
In driver 3.5, we introduced some new connection pool-related options -- `maxPoolSize` and `minPoolSize` -- which were only respected when `useUnifiedTopology` was set to `true`. These options had legacy equivalents named `poolSize` and `minSize`, respectively, which could be used both with and without `useUnifiedTopology` set to `true`.

In driver 4.0, the legacy options have been removed, and only `maxPoolSize` and `minPoolSize` are supported. We have added options validation which should help you identify any usages of the old names.

Please note that the default value for the maximum pool size has changed over time. In driver 3.x **without** `useUnifiedTopology` set to `true`, the default value was 100. In driver 3.x **with** `useUnifiedTopology` set to true, the default was 10.

In this release, we have changed the default value for `maxPoolSize` to 100, in compliance with the drivers [connection pooling specification](https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst).

#### Unified Topology Only

Expand Down

0 comments on commit 7998956

Please sign in to comment.