@@ -7,7 +7,7 @@ Connection Pools
7
7
.. contents:: On this page
8
8
:local:
9
9
:backlinks: none
10
- :depth: 1
10
+ :depth: 2
11
11
:class: singlecol
12
12
13
13
.. facet::
@@ -17,8 +17,17 @@ Connection Pools
17
17
Overview
18
18
--------
19
19
20
- This guide shows you how to create and configure a connection pool associated
21
- with a ``MongoClient``.
20
+ In this guide, you can learn about how {+driver-short+} uses connection pools to manage
21
+ connections to a MongoDB deployment and how you can configure connection pool settings
22
+ in your application.
23
+
24
+ A connection pool is a cache of open database connections maintained by {+driver-short+}.
25
+ When your application requests a connection to MongoDB, {+driver-short+} seamlessly
26
+ gets a connection from the pool, performs operations, and returns the connection
27
+ to the pool for reuse.
28
+
29
+ Connection pools help reduce application latency and the number of times new connections
30
+ are created by {+driver-short+}.
22
31
23
32
Create and Use a Connection Pool
24
33
--------------------------------
@@ -54,7 +63,7 @@ by using either a connection string or ``MongoClientSettings`` object:
54
63
55
64
MongoClient mongoClient = MongoClients.create("mongodb://<host>:<port>/?maxPoolSize=50")
56
65
57
- .. tab:: `` MongoClientSettings``
66
+ .. tab:: MongoClientSettings
58
67
:tabid: MongoClient
59
68
60
69
.. literalinclude:: /includes/fundamentals/code-snippets/ConnectionPool.java
@@ -63,14 +72,6 @@ by using either a connection string or ``MongoClientSettings`` object:
63
72
:language: java
64
73
:dedent:
65
74
66
- For more information on these connection string options, see the
67
- :ref:`Connection Options <connection-options>`
68
- guide.
69
-
70
- For more information on configuring you connection pool by using a
71
- ``MongoClientSettings`` object see the Connection Pool Settings section
72
- of the :ref:`<specify-mongoclient-settings>` guide.
73
-
74
75
Connection Pool Settings
75
76
~~~~~~~~~~~~~~~~~~~~~~~~
76
77
@@ -146,6 +147,14 @@ connection pool:
146
147
147
148
*Default*: ``120000`` (120 seconds)
148
149
150
+ For more information on these connection string options, see the
151
+ :ref:`Connection Options <connection-options>`
152
+ guide.
153
+
154
+ For more information on configuring you connection pool by using a
155
+ ``MongoClientSettings`` object see the Connection Pool Settings section
156
+ of the :ref:`<specify-mongoclient-settings>` guide.
157
+
149
158
Additional Information
150
159
----------------------
151
160
0 commit comments