Skip to content

DOCS-3613: Warn around altering maxIncomingConnections #2260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions source/faq/sharding.txt
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,7 @@ What does the ``maxConns`` setting on ``mongos`` do?
The :setting:`~net.maxIncomingConnections` option limits the number of connections
accepted by :program:`mongos`.

If your client driver or application creates a large number of
connections but allows them to time out rather than closing them
explicitly, then it might make sense to limit the number of
connections at the :program:`mongos` layer.

Set :setting:`~net.maxIncomingConnections` to a value slightly higher than the
maximum number of connections that the client creates, or the maximum
size of the connection pool. This setting prevents the
:program:`mongos` from causing connection spikes on the individual
:term:`shards <shard>`. Spikes like these may disrupt the operation
and memory allocation of the :term:`sharded cluster`.
.. include:: /includes/fact-maxconns-mongos.rst

How do indexes impact queries in sharded systems?
-------------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions source/includes/fact-maxconns-mongos.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This is particularly useful for a :program:`mongos` if you have a client
that creates multiple connections and allows them to timeout rather
than closing them.

In this case, set :setting:`~net.maxIncomingConnections` to a value slightly
higher than the maximum number of connections that the client creates, or the
maximum size of the connection pool.

This setting prevents the :program:`mongos` from causing connection spikes on
the individual :term:`shards <shard>`. Spikes like these may disrupt the
operation and memory allocation of the :term:`sharded cluster`.
8 changes: 2 additions & 6 deletions source/includes/options-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,8 @@ inherit:
program: mongod
file: options-mongod.yaml
post: |
This is particularly useful for a :program:`mongos` if you have a client
that creates a number of connections but allows them to timeout rather
than close the connections. When you set this option, ensure the value
is slightly higher than the size of the connection pool or the total
number of connections, to prevent erroneous connection spikes from
propagating to the members of a sharded cluster.
.. include:: /includes/fact-maxconns-mongos.rst

---
program: conf
name: net.wireObjectCheck
Expand Down
6 changes: 4 additions & 2 deletions source/includes/options-mongod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ description: |
accept. This setting has no effect if it is higher than your operating
system's configured maximum connection tracking threshold.

.. versionchanged:: 2.6
MongoDB removed the upward limit on the :setting:`~net.maxIncomingConnections` setting.
Do not assign too low of a value to this option, or you will encounter errors
during normal application operation.
post: |
.. include:: /includes/note-max-conns-max.rst
optional: true
---
program: mongod
Expand Down
21 changes: 7 additions & 14 deletions source/includes/options-mongos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,15 @@ program: mongos
name: maxConns
args: <number>
directive: option
description: |
Specifies the maximum number of simultaneous connections that
:program:`mongos` will accept. This setting will have no effect if the
value of this setting is higher than your operating system's configured
maximum connection tracking threshold.
inherit:
name: maxConns
program: mongod
file: options-mongod.yaml
post: |
.. include:: /includes/fact-maxconns-mongos.rst

This setting is particularly useful for :program:`mongos` if you
have a client that creates a number of connections but allows them
to timeout rather than close the connections. When you set
:setting:`~net.maxIncomingConnections`, ensure the value is slightly
higher than the size of the connection pool or the total number of
connections to prevent erroneous connection spikes from propagating
to the members of a :term:`sharded cluster`.
.. include:: /includes/note-max-conns-max.rst

.. versionchanged:: 2.6
MongoDB removed the upward limit on the :setting:`~net.maxIncomingConnections` setting.
optional: true
---
program: mongos
Expand Down