44Connection Pool Overview
55========================
66
7+ .. facet::
8+ :name: genre
9+ :values: reference
10+
711.. default-domain:: mongodb
812
913.. contents:: On this page
@@ -79,13 +83,13 @@ to be established.
7983Connection Pool Configuration Settings
8084--------------------------------------
8185
82- To configure the connection pool, set the options :
86+ You can specify connection pool settings in these locations :
8387
84- - through the :ref:`MongoDB URI <mongodb-uri>`,
88+ - The :ref:`MongoDB URI <mongodb-uri>`
8589
86- - programmatically when building the ``MongoClient`` instance, or
90+ - Your application's ``MongoClient`` instance
8791
88- - in your application framework's configuration files.
92+ - Your application framework's configuration files
8993
9094Settings
9195~~~~~~~~
@@ -97,6 +101,33 @@ Settings
97101 * - Setting
98102 - Description
99103
104+ * - :urioption:`connectTimeoutMS`
105+
106+ - Most drivers default to never time out. Some versions of the
107+ Java drivers (for example, version 3.7) default to ``10``.
108+
109+ *Default:* ``0`` for most drivers. See your :driver:`driver </>`
110+ documentation.
111+
112+ * - :urioption:`maxConnecting`
113+
114+ - Maximum number of connections a pool may be establishing
115+ concurrently.
116+
117+ ``maxConnecting`` is supported for all drivers **except** the
118+ :driver:`Rust Driver </rust/current/>`.
119+
120+ .. include:: /includes/connection-pool/max-connecting-use-case.rst
121+
122+ *Default:* ``2``
123+
124+ * - :urioption:`maxIdleTimeMS`
125+
126+ - The maximum number of milliseconds that a connection can
127+ remain idle in the pool before being removed and closed.
128+
129+ *Default:* See your :driver:`driver </>` documentation.
130+
100131 * - :urioption:`maxPoolSize`
101132
102133 - .. _maxpoolsize-cp-setting:
@@ -118,51 +149,31 @@ Settings
118149
119150 *Default*: ``0``
120151
121- * - :urioption:`connectTimeoutMS`
122-
123- - Most drivers default to never time out. Some versions of the
124- Java drivers (for example, version 3.7) default to ``10``.
125-
126- *Default:* ``0`` for most drivers. See your :driver:`driver </>`
127- documentation.
152+ * - :parameter:`ShardingTaskExecutorPoolMaxSize`
128153
129- * - :urioption:`socketTimeoutMS`
154+ - Maximum number of outbound connections each TaskExecutor
155+ connection pool can open to any given :binary:`~bin.mongod`
156+ instance.
130157
131- - Number of milliseconds to wait before timeout on a TCP
132- connection.
133-
134- Do *not* use :urioption:`socketTimeoutMS` as a mechanism for
135- preventing long-running server operations.
158+ *Default*: 2\ :sup:`64` - 1
136159
137- Setting low socket timeouts may result in operations that error
138- before the server responds.
139-
140- *Default*: ``0``, which means no timeout. See your
141- :driver:`driver </>` documentation.
160+ Parameter only applies to sharded deployments.
142161
143- * - :urioption:`maxIdleTimeMS`
144-
145- - The maximum number of milliseconds that a connection can
146- remain idle in the pool before being removed and closed.
162+ * - :parameter:`ShardingTaskExecutorPoolMaxSizeForConfigServers`
147163
148- *Default:* See your :driver:`driver </>` documentation.
164+ - .. include:: /includes/ShardingTaskExecutorPoolMaxSizeForConfigServers-parameter.rst
149165
150- * - :urioption:`waitQueueTimeoutMS `
166+ *Default*: ``-1` `
151167
152- - Maximum wait time in milliseconds that a can thread wait for
153- a connection to become available. A value of ``0`` means there
154- is no limit.
168+ .. versionadded:: 6.0
155169
156- *Default*: ``0``. See your :driver:`driver </>` documentation.
157-
158170 * - :parameter:`ShardingTaskExecutorPoolMinSize`
159171
160172 - Minimum number of outbound connections each TaskExecutor
161173 connection pool can open to any given :binary:`~bin.mongod`
162174 instance.
163175
164- *Default*: ``1``. See
165- :parameter:`ShardingTaskExecutorPoolMinSize`.
176+ *Default*: ``1``
166177
167178 Parameter only applies to sharded deployments.
168179
@@ -174,24 +185,26 @@ Settings
174185
175186 .. versionadded:: 6.0
176187
177- * - :parameter:`ShardingTaskExecutorPoolMaxSize`
178-
179- - Maximum number of outbound connections each TaskExecutor
180- connection pool can open to any given :binary:`~bin.mongod`
181- instance.
182-
183- *Default*: 2\ :sup:`64` - 1. See
184- :parameter:`ShardingTaskExecutorPoolMaxSize`.
188+ * - :urioption:`socketTimeoutMS`
185189
186- Parameter only applies to sharded deployments.
190+ - Number of milliseconds to wait before timeout on a TCP
191+ connection.
192+
193+ Do *not* use :urioption:`socketTimeoutMS` as a mechanism for
194+ preventing long-running server operations.
187195
188- * - :parameter:`ShardingTaskExecutorPoolMaxSizeForConfigServers`
196+ Setting low socket timeouts may result in operations that error
197+ before the server responds.
198+
199+ *Default*: ``0``, which means no timeout.
189200
190- - .. include:: /includes/ShardingTaskExecutorPoolMaxSizeForConfigServers-parameter.rst
201+ * - :urioption:`waitQueueTimeoutMS`
191202
192- *Default*: ``-1``
203+ - Maximum wait time in milliseconds that a can thread wait for
204+ a connection to become available. A value of ``0`` means there
205+ is no limit.
193206
194- .. versionadded:: 6.0
207+ *Default*: ``0``
195208
196209.. toctree::
197210 :titlesonly:
0 commit comments