summaryrefslogtreecommitdiff
path: root/src/mongo/executor/connection_pool.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/executor/connection_pool.h')
-rw-r--r--src/mongo/executor/connection_pool.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/executor/connection_pool.h b/src/mongo/executor/connection_pool.h
index a5bcc1c3925..ea4d9234cbf 100644
--- a/src/mongo/executor/connection_pool.h
+++ b/src/mongo/executor/connection_pool.h
@@ -67,9 +67,11 @@ public:
using GetConnectionCallback = stdx::function<void(StatusWith<ConnectionHandle>)>;
- static const Milliseconds kDefaultRefreshTimeout;
- static const Milliseconds kDefaultRefreshRequirement;
- static const Milliseconds kDefaultHostTimeout;
+ static constexpr Milliseconds kDefaultHostTimeout = Milliseconds(300000); // 5mins
+ static const size_t kDefaultMaxConns;
+ static const size_t kDefaultMinConns;
+ static constexpr Milliseconds kDefaultRefreshRequirement = Milliseconds(60000); // 1min
+ static constexpr Milliseconds kDefaultRefreshTimeout = Milliseconds(20000); // 20secs
static const Status kConnectionStateUnknown;
@@ -80,14 +82,14 @@ public:
* The minimum number of connections to keep alive while the pool is in
* operation
*/
- size_t minConnections = 1;
+ size_t minConnections = kDefaultMinConns;
/**
* The maximum number of connections to spawn for a host. This includes
* pending connections in setup and connections checked out of the pool
* as well as the obvious live connections in the pool.
*/
- size_t maxConnections = std::numeric_limits<size_t>::max();
+ size_t maxConnections = kDefaultMaxConns;
/**
* Amount of time to wait before timing out a refresh attempt